赞 | 0 |
VIP | 0 |
好人卡 | 1 |
积分 | 1 |
经验 | 10671 |
最后登录 | 2017-5-16 |
在线时间 | 130 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 130 小时
- 注册时间
- 2016-1-14
- 帖子
- 131
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
如上图,我已经把其他准备好了,就差在图中红框里插入人物头像。
我其实也试过了,但却只能插入一张人物头像,在换人之后也一直没有变过,如下图:
所以在此想请教高手一下,如何才能让这张肖像图跟着人物的选择而改变?!
具体脚本如下:
1.这是Window_BattleStatus中的脚本:
#encoding:utf-8
#==============================================================================
# ■ Window_BattleStatus
#------------------------------------------------------------------------------
# 战斗画面中,显示“队伍成员状态”的窗口。
#==============================================================================
class Window_BattleStatus < Window_Selectable
#--------------------------------------------------------------------------
# ● 初始化对象
#--------------------------------------------------------------------------
def initialize
super(0, 0, window_width, window_height)
refresh
self.openness = 0
end
#--------------------------------------------------------------------------
# ● 获取窗口的宽度
#--------------------------------------------------------------------------
def window_width
Graphics.width - 128
end
#--------------------------------------------------------------------------
# ● 获取窗口的高度
#--------------------------------------------------------------------------
def window_height
fitting_height(visible_line_number)
end
#--------------------------------------------------------------------------
# ● 获取显示行数
#--------------------------------------------------------------------------
def visible_line_number
return 4
end
#--------------------------------------------------------------------------
# ● 获取项目数
#--------------------------------------------------------------------------
def item_max
$game_party.battle_members.size
end
#--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
contents.clear
draw_all_items
end
#--------------------------------------------------------------------------
# ● 绘制项目
#--------------------------------------------------------------------------
def draw_item(index)
actor = $game_party.battle_members[index]
# draw_basic_area(basic_area_rect(index), actor) #基本区域
draw_gauge_area(gauge_area_rect(index), actor) #状态
draw_actor_face(actor, x, y, enabled = true) #绘制肖像
end
#--------------------------------------------------------------------------
# ● 获取基本区域的矩形
#--------------------------------------------------------------------------
def basic_area_rect(index)
rect = item_rect_for_text(index)
rect.width = gauge_area_width + 10
rect
end
#--------------------------------------------------------------------------
# ● 获取值槽区域的矩形
#--------------------------------------------------------------------------
def gauge_area_rect(index)
rect = item_rect_for_text(index)
rect.x += rect.width - gauge_area_width - 10
rect.y += -3
rect.width = gauge_area_width
rect
end
#--------------------------------------------------------------------------
# ● 获取值槽区域的宽度
#--------------------------------------------------------------------------
def gauge_area_width
return 230
end
#--------------------------------------------------------------------------
# ● 绘制基本区域
#--------------------------------------------------------------------------
#def draw_basic_area(rect, actor)
# draw_actor_name(actor, rect.x + 0, rect.y, 100)
# draw_actor_icons(actor, rect.x + 104, rect.y, rect.width - 104)
# end
#--------------------------------------------------------------------------
# ● 绘制角色肖像图
# enabled : 有效的标志。false 的时候使用半透明效果绘制
#--------------------------------------------------------------------------
def draw_face(face_name, face_index, x, y, enabled = true)
bitmap = Cache.face(face_name)
rect = Rect.new(face_index % 4 * 96, face_index / 4 * 96, 96, 96)
contents.blt(x - 140, y, bitmap, rect, enabled ? 255 : translucent_alpha)
bitmap.dispose
end
#--------------------------------------------------------------------------
# ● 绘制值槽区域
#--------------------------------------------------------------------------
def draw_gauge_area(rect, actor)
if $data_system.opt_display_tp
draw_gauge_area_with_tp(rect, actor)
else
draw_gauge_area_without_tp(rect, actor)
end
end
#--------------------------------------------------------------------------
# ● 绘制值槽区域(包括 TP)
#--------------------------------------------------------------------------
def draw_gauge_area_with_tp(rect, actor)
draw_actor_hp(actor, rect.x + 0, rect.y, 72)
draw_actor_mp(actor, rect.x + 82, rect.y, 64)
draw_actor_tp(actor, rect.x + 156, rect.y, 64)
end
#--------------------------------------------------------------------------
# ● 绘制值槽区域(不包括 TP)
#--------------------------------------------------------------------------
def draw_gauge_area_without_tp(rect, actor)
draw_actor_hp(actor, rect.x + 0, rect.y, 134)
draw_actor_mp(actor, rect.x + 144, rect.y, 76)
end
end
[/quote] |
|