QQ图片20151023233045.png (5.5 KB, 下载次数: 22)
#============================================================================== # ■ Game_Actor #============================================================================== # 截图上的坐标,这部分来自你那个工程的最后一段里,可以删掉。 class Game_Actor < Game_Battler #-------------------------------------------------------------------------- # ● 战斗者调 X 坐标。 #-------------------------------------------------------------------------- def screen_x if self.index != nil case self.index when 0 return 270 when 1 return 340 when 2 return 410 when 3 return 480 end else return 0 end end #-------------------------------------------------------------------------- # ● 战斗者调 Y 坐标。 #-------------------------------------------------------------------------- def screen_y if self.index != nil case self.index when 0 return 400 when 1 return 360 when 2 return 320 when 3 return 280 end else return 0 end end end # ↑↑↑ -=-=- 以上部分请删除 -=-=- #============================================================================== # ■ Window_PartyCommand #============================================================================== class Window_PartyCommand < Window_Command #-------------------------------------------------------------------------- # ● 初始化对象 #-------------------------------------------------------------------------- def initialize super(388, 372) self.openness = 0 deactivate end #-------------------------------------------------------------------------- # ● 获取窗口的宽度 #-------------------------------------------------------------------------- def window_width return 96 end #-------------------------------------------------------------------------- # ● 获取显示行数 #-------------------------------------------------------------------------- def visible_line_number return 2 end #-------------------------------------------------------------------------- # ● 获取对齐方式 #-------------------------------------------------------------------------- def alignment return 1 end end #============================================================================== # ■ Window_ActorCommand #============================================================================== class Window_ActorCommand < Window_Command #-------------------------------------------------------------------------- # ● 获取对齐方式 #-------------------------------------------------------------------------- def alignment return 1 end #-------------------------------------------------------------------------- # ● 获取窗口的宽度 #-------------------------------------------------------------------------- def window_width return 96 end #-------------------------------------------------------------------------- # ● 设置 #-------------------------------------------------------------------------- def setup(actor) @actor = actor self.x = actor.screen_x - self.width / 2 + 180 self.y = actor.screen_y clear_command_list make_command_list refresh select(0) show.activate open end end #============================================================================== # ■ Window_BattleStatus #============================================================================== class Window_BattleStatus < Window_Selectable #-------------------------------------------------------------------------- # ● 初始化对象 #-------------------------------------------------------------------------- def initialize super(0, 10, window_width, window_height) refresh self.opacity = 0 self.openness = 0 end #-------------------------------------------------------------------------- # ◆ 获取窗口的宽度 #-------------------------------------------------------------------------- def window_width return 640 end #-------------------------------------------------------------------------- # ● 获取窗口的高度 #-------------------------------------------------------------------------- def window_height Graphics.height + 200 end #-------------------------------------------------------------------------- # ◆ 绘制基本区域 #-------------------------------------------------------------------------- def draw_basic_area(rect, actor) # 乌鸦飞过.... end #-------------------------------------------------------------------------- # ● 绘制值槽区域(包括 TP) #-------------------------------------------------------------------------- def draw_gauge_area_with_tp(rect, actor) contents.font.size = 18 ax = actor.screen_x - 80 ay = actor.screen_y + 108 draw_text(ax, ay, 30, line_height, "HP") draw_text(ax, ay + 16, 30, line_height, "MP") draw_text(ax, ay + 32, 30, line_height, "TP") draw_text(ax + 8, ay, 52, line_height, actor.hp, 2) draw_text(ax + 8, ay + 16, 52, line_height, actor.mp, 2) draw_text(ax + 8, ay + 32, 52, line_height, actor.tp.to_i, 2) end #-------------------------------------------------------------------------- # ● 绘制值槽区域(不包括 TP) #-------------------------------------------------------------------------- def draw_gauge_area_without_tp(rect, actor) contents.font.size = 18 ax = actor.screen_x - 80 ay = actor.screen_y + 124 draw_text(ax, ay, 30, line_height, "HP") draw_text(ax, ay + 16, 30, line_height, "MP") draw_text(ax + 8, ay, 52, line_height, actor.hp, 2) draw_text(ax + 8, ay + 16, 52, line_height, actor.mp, 2) end end #============================================================================== # ■ Window_BattleEnemy #============================================================================== class Window_BattleEnemy < Window_Selectable #-------------------------------------------------------------------------- # ● 显示窗口 #-------------------------------------------------------------------------- def show if @info_viewport width_remain = Graphics.width self.x = 0 @info_viewport.rect.width = width_remain select(0) end super end end #============================================================================== # ■ Window_BattleSkill #============================================================================== class Window_BattleSkill < Window_SkillList #-------------------------------------------------------------------------- # ● 初始化对象 #-------------------------------------------------------------------------- def initialize(help_window, info_viewport) y = help_window.height super(0, y, Graphics.width, Graphics.height - help_window.height) self.visible = false @help_window = help_window @info_viewport = info_viewport end end #============================================================================== # ■ Window_BattleItem #============================================================================== class Window_BattleItem < Window_ItemList #-------------------------------------------------------------------------- # ● 初始化对象 #-------------------------------------------------------------------------- def initialize(help_window, info_viewport) y = help_window.height super(0, y, Graphics.width, Graphics.height - help_window.height) self.visible = false @help_window = help_window @info_viewport = info_viewport end end #============================================================================== # ■ Scene_Battle #============================================================================== class Scene_Battle < Scene_Base #-------------------------------------------------------------------------- # ● 更新信息显示的显示端口 #-------------------------------------------------------------------------- def update_info_viewport move_info_viewport(164) if @party_command_window.active move_info_viewport(164) if @actor_command_window.active move_info_viewport(-50) if BattleManager.in_turn? end #-------------------------------------------------------------------------- # ● 生成状态窗口 #-------------------------------------------------------------------------- def create_status_window @status_window = Window_BattleStatus.new @status_window.x = 204 end #-------------------------------------------------------------------------- # ● 生成信息显示的显示端口 #-------------------------------------------------------------------------- def create_info_viewport @info_viewport = Viewport.new @info_viewport.rect.y = -200 @info_viewport.rect.height = Graphics.height + 200 @info_viewport.z = 100 @info_viewport.ox = 64 @status_window.viewport = @info_viewport end #-------------------------------------------------------------------------- # ● 生成敌人窗口 #-------------------------------------------------------------------------- def create_enemy_window @enemy_window = Window_BattleEnemy.new(@info_viewport) @enemy_window.y = Graphics.height - 120 @enemy_window.set_handler(:ok, method(:on_enemy_ok)) @enemy_window.set_handler(:cancel, method(:on_enemy_cancel)) end end
欢迎光临 Project1 (https://rpg.blue/) | Powered by Discuz! X3.1 |