#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(4) end #-------------------------------------------------------------------------- # ● 获取项目数 #-------------------------------------------------------------------------- def item_max $game_party.battle_members.size end #-------------------------------------------------------------------------- # ● 刷新 #-------------------------------------------------------------------------- def refresh contents.clear draw_all_items end #-------------------------------------------------------------------------- # ● 描绘项目 #-------------------------------------------------------------------------- def draw_item(index) rect = item_rect(index) rect.x += 4 rect.width -= 8 self.contents.clear_rect(rect) self.contents.font.color = normal_color actor = $game_party.members[index] draw_actor_face(actor, rect.x , rect.y-20 ) draw_actor_name(actor, index * 100, rect.y + 2) #draw_actor_icons(actor, rect.x + 104, rect.y, rect.width - 104) draw_actor_icons(actor, index * 100 + 8, 36, 24) draw_crhp(rect.x-4,rect.y+64,actor.hp,actor.mhp,"") draw_crmp(rect.x-4,rect.y+76,actor.mp,actor.mmp,"") draw_actor_tp(actor, index * 100, 60, 72) end #---------------------------------------------------------------------- # ● 设置光标的位置 # index : 新的光标位置 #-------------------------------------------------------------------------- def index=(index) @index = index update_cursor refresh end #-------------------------------------------------------------------------- # ● 获取项目描画矩形 # index : 项目编号 #-------------------------------------------------------------------------- def item_rect(index) rect = Rect.new(0, 0, 0, 0) rect.width = contents.width - 113 rect.height = 24 rect.x = index * 100 rect.y = 0 return rect end #-------------------------------------------------------------------------- # ● 更新光标矩形 #-------------------------------------------------------------------------- def update_cursor case @index when 0...4 self.cursor_rect.set(@index * 100, 0, 100, 96) else self.cursor_rect.empty # 光标无效 end end end
QQ截图20141112232143.png (93.95 KB, 下载次数: 25)
欢迎光临 Project1 (https://rpg.blue/) | Powered by Discuz! X3.1 |