赞 | 676 |
VIP | 62 |
好人卡 | 144 |
积分 | 336 |
经验 | 110435 |
最后登录 | 2024-11-1 |
在线时间 | 5108 小时 |
Lv5.捕梦者
- 梦石
- 0
- 星屑
- 33632
- 在线时间
- 5108 小时
- 注册时间
- 2012-11-19
- 帖子
- 4878
|
本人来解决LZ第二个问题
脚本:- class Window_Base < Window
- def draw_actor_xdrs(actor, x, y)
- bitmap = RPG::Cache.character(actor.character_name, actor.character_hue)
- cw = bitmap.width
- ch = bitmap.height
- src_rect = Rect.new(0, 0, cw, ch)
- self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect)
- end
- end
- #============================================================================
- class Window_ActorCommand < Window_Selectable
- #--------------------------------------------------------------------------
- def initialize
- super(0, 0, 640, 64)
- self.contents = Bitmap.new(width - 32, height - 32)
- @item_max = 3
- @column_max = 3
- @commands = [$data_system.words.item, "存档", "结束"]
- refresh
- self.index = 0
- end
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- for i in 0...@item_max
- draw_item(i)
- end
- end
- #--------------------------------------------------------------------------
- def draw_item(index)
- x = 65 + index * 213
- self.contents.draw_text(x, 0, 128, 32, @commands[index])
- end
- #--------------------------------------------------------------------------
- def update_cursor_rect
- self.cursor_rect.set(24 + index * 213, 0, 128, 32)
- end
- end
- class Window_MenuShow < Window_Base
- #--------------------------------------------------------------------------
- def initialize
- super(0, 384, 640, 96)
- self.contents = Bitmap.new(width - 32, height - 32)
- refresh
- end
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- self.contents.font.color = system_color
- self.contents.draw_text(4, 0, 120, 32, "游戏时间")
- @total_sec = Graphics.frame_count / Graphics.frame_rate
- hour = @total_sec / 60 / 60
- min = @total_sec / 60 % 60
- sec = @total_sec % 60
- text = sprintf("%02d:%02d:%02d", hour, min, sec)
- self.contents.font.color = normal_color
- self.contents.draw_text(4, 32, 120, 32, text, 2)
- self.contents.font.color = system_color
- self.contents.draw_text(324, 0, 120, 32, "步数")
- self.contents.font.color = normal_color
- self.contents.draw_text(324, 32, 120, 32, $game_party.steps.to_s, 2)
- end
- #--------------------------------------------------------------------------
- def update
- super
- if Graphics.frame_count / Graphics.frame_rate != @total_sec
- refresh
- end
- end
- end
- class Window_Back_a < Window_Base
- #--------------------------------------------------------------------------
- def initialize
- super(0, 64, 214, 320)
- self.contents = Bitmap.new(width - 32, height - 32)
- end
- end
- class Window_Back_b < Window_Base
- #--------------------------------------------------------------------------
- def initialize
- super(214, 64, 426, 320)
- self.contents = Bitmap.new(width - 32, height - 32)
- end
- end
- class Window_ActorStatus < Window_Base
- #--------------------------------------------------------------------------
- def initialize
- super(0, 64, 640, 320)
- self.contents = Bitmap.new(width - 32, height - 32)
- self.opacity = 0
- refresh
- end
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- actor = $game_party.actors[0]
- draw_actor_xdrs(actor, 80, 226)
- draw_actor_name(actor, 300, 64)
- draw_actor_state(actor, 480, 0)
- draw_actor_hp(actor, 300, 106)
- draw_actor_sp(actor, 300, 148)
- end
- end
- #==============================================================================
- class Scene_Menu
- #--------------------------------------------------------------------
- def main
- @command_window = Window_ActorCommand.new
- if $game_system.save_disabled
- @command_window.disable_item(1)
- end
- @menushow_window = Window_MenuShow.new
- @status_window = Window_ActorStatus.new
- @backa_window = Window_Back_a.new
- @backb_window = Window_Back_b.new
- Graphics.transition
- loop do
- Graphics.update
- Input.update
- update
- if $scene != self
- break
- end
- end
- Graphics.freeze
- @command_window.dispose
- @menushow_window.dispose
- @status_window.dispose
- @backa_window.dispose
- @backb_window.dispose
- end
- #--------------------------------------------------------------------------
- def update
- @command_window.update
- @menushow_window.update
- @status_window.update
- @backa_window.update
- @backb_window.update
- if @command_window.active
- update_command
- return
- end
- end
- #--------------------------------------------------------------------------
- def update_command
- if Input.trigger?(Input::B)
- $game_system.se_play($data_system.cancel_se)
- $scene = Scene_Map.new
- return
- end
- if Input.trigger?(Input::C)
- if $game_party.actors.size == 0 and @command_window.index < 4
- $game_system.se_play($data_system.buzzer_se)
- return
- end
- case @command_window.index
- when 0
- $game_system.se_play($data_system.decision_se)
- $scene = Scene_Item.new
- when 1
- if $game_system.save_disabled
- $game_system.se_play($data_system.buzzer_se)
- return
- end
- $game_system.se_play($data_system.decision_se)
- $scene = Scene_Save.new
- when 2
- $game_system.se_play($data_system.decision_se)
- $scene = Scene_End.new
- return
- end
- end
- end
- end
复制代码 复制插到 main 前
由于竖向选择不好排版,我改横向。效果:
人物的战斗图,放在character 文件夹下。 |
|