Project1
标题:
请问如何做在选择角色时显示头像??
[打印本页]
作者:
sdsmn
时间:
2008-10-8 15:53
标题:
请问如何做在选择角色时显示头像??
就是类似这个图里的,在选择由哪个人物行动时显示头像 [LINE]1,#dddddd[/LINE]
此贴于 2008-10-16 13:26:31 被版主八云紫提醒,请楼主看到后对本贴做出回应。
[LINE]1,#dddddd[/LINE]
版务信息:版主帮忙结贴~
作者:
木葬枫
时间:
2008-10-8 16:00
楼主要在哪里显示图片?战斗中?普通的场景选择?
[LINE]1,#dddddd[/LINE]
如果要在战斗中加入头像……搜索柳柳的贴子……他发过这个脚本……
作者:
塑望
时间:
2008-10-9 06:16
#==============================================================================
# 显示头像的战斗信息框 by 沉影不器
#------------------------------------------------------------------------------
# 功能: 给战斗信息框添加头像显示
#
# 由于敌人没有头像,目前vx素材又少,用战斗图装凑合着显示
# 超过96*96的战斗图,取战斗图顶部居中的96*96方框图像
#==============================================================================
#==============================================================================
# ■ Scene_Battle
#------------------------------------------------------------------------------
# 处理战斗画面的类。
#==============================================================================
class Scene_Battle < Scene_Base
attr_reader :active_battler
end
#==============================================================================
# ■ Window_Base
#------------------------------------------------------------------------------
# 游戏中全部窗口的超级类。
#==============================================================================
class Window_Base < Window
#--------------------------------------------------------------------------
# ● 描绘敌人脸谱图像
#--------------------------------------------------------------------------
def draw_enemy_face(actor, x, y, size = 96)
draw_battler(actor.battler_name, actor.battler_hue, x, y, size)
end
#--------------------------------------------------------------------------
# ● 描绘战斗图
#--------------------------------------------------------------------------
def draw_battler(battler_name, battler_hue, x, y, size = 96)
@battler_name = battler_name
@battler_hue = battler_hue
bitmap = Cache.battler(@battler_name, @battler_hue).clone
rect = Rect.new(0, 0, 0, 0)
rect.x = [bitmap.width/2 - 48, 0].max
rect.width = size
rect.height = size
self.contents.blt(x, y, bitmap, rect)
bitmap.dispose
end
end
#==============================================================================
# ■ Window_BattleMessage
#------------------------------------------------------------------------------
# 在战斗中显示消息的窗口。附加有普通消息窗口的功能、显示战斗进行中提示的
# 的机能。
#==============================================================================
class Window_BattleMessage < Window_Message
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
self.contents.clear
for i in
[email protected]
draw_line(i)
end
return unless $scene.is_a?(Scene_Battle)
if $scene.active_battler != nil
battler = $scene.active_battler
if battler.is_a?(Game_Enemy)
draw_enemy_face($scene.active_battler, 0, 0, 96)
else
draw_actor_face($scene.active_battler, 0, 0, 96)
end
end
end
#--------------------------------------------------------------------------
# ● 描绘行
# index : 行编号
#--------------------------------------------------------------------------
def draw_line(index)
rect = Rect.new(0, 0, 0, 0)
rect.x += 4 + 96
rect.y += index * WLH
rect.width = contents.width - 8
rect.height = WLH
self.contents.clear_rect(rect)
self.contents.font.color = normal_color
self.contents.draw_text(rect, @lines[index])
end
end
复制代码
符合你所有要求 [LINE]1,#dddddd[/LINE]
系统信息:本贴由本区版主认可为正确答案,66RPG感谢您的热情解答~
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1