class Window_Base < Window
#--------------------------------------------------------------------------
# ● 描绘状态
# actor : 角色
# x : 描画目标 X 坐标
# y : 描画目标 Y 坐标
# width : 描画目标的宽
#--------------------------------------------------------------------------
def draw_actor_state(actor, x, y, width = 120)
state_size = 0
for state in actor.states
# 图标数量超出宽度就中断循环
if state_size >= width / 16
break
end
# 此状态不带图标就跳过
if !ICON_STATE_IDS.include?(state)
next
end
bitmap = RPG::Cache.icon($data_states[state].name + "_sta.png")
if actor.states_turn[state] >= $data_states[state].hold_turn/2
opacity = 255
else
opacity = 100
end
# 这里的图标大小默认是16x16,要改就改下面那个Rect.new(0, 0, 16, 16)
self.contents.blt(x + 16 * state_size, y + 32, bitmap, Rect.new(0, 0, 16, 16), opacity)
state_size += 1
end
end
end