赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 1 |
经验 | 1730 |
最后登录 | 2018-8-25 |
在线时间 | 12 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 98
- 在线时间
- 12 小时
- 注册时间
- 2008-4-29
- 帖子
- 461
|
- class Window_1 < Window_Base
- def initialize
- super(0, 0, 640,100)
- self.contents = Bitmap.new(width-32, height-32)
- self.contents.font.name = "黑体"
- self.contents.font.size = 20
- refresh
- end
- def refresh
- self.contents.clear
- self.contents.font.color = text_color(6)
- self.contents.draw_text(0, 0, 100, 32, "游戏时间:")
- #显示游戏时间 (从 Window_PlayTime中Copy来)
- @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(100, 0, 120, 32, text)
- # 结束显示游戏时间的编码
- self.contents.font.color = text_color(6)
- self.contents.draw_text(250, 0, 50, 32, "金钱:")
- self.contents.font.color = text_color(0)
- self.contents.draw_text(305, 0, 100, 32, $game_party.gold.to_s)
- self.contents.font.color = text_color(6)
- self.contents.draw_text(400, 0, 100, 32, "地图ID:")
- self.contents.font.color = text_color(0)
- self.contents.draw_text(480, 0, 100, 32, $game_map.map_id.to_s)
- end
- def update
- if Graphics.frame_count / Graphics.frame_rate != @total_sec
- refresh
- end
- end
- end
-
- class Window_2 < Window_Base
- def initialize
- super(0, 0, 200,380)
- self.contents = Bitmap.new(width-32, height-32)
- self.contents.font.name = "黑体"
- self.contents.font.size = 20
- for i in 0...$game_party.actors.size
- x = 0
- y = i * 90
- actor = $game_party.actors[i]
- self.contents.font.color = text_color(6)
- self.contents.draw_text(x, y, 200, 32, actor.name)
- self.contents.font.color = text_color(4)
- self.contents.draw_text(x, y+32, 200, 32, actor.class_name)
- end
- end
- end
- class Window_3 < Window_Base
- def initialize
- super(0, 0, 440,380)
- self.contents = Bitmap.new(width-32, height-32)
- self.contents.font.name = "黑体"
- self.contents.font.size = 20
- for i in 0...$game_party.actors.size
- x = 0
- y = i * 150
- if i >= 2
- x=250
- y-=300
- end
- actor = $game_party.actors[i]
- self.contents.font.color = text_color(6)
- self.contents.draw_text(x, y, 200, 32, actor.name)
- offset_x=contents.text_size(actor.name).width+10
- self.contents.font.color = text_color(4)
- self.contents.draw_text(x+offset_x, y, 200, 32, "Lv: " + actor.level.to_s)
- draw_actor_hp(actor, x, y+32)
- draw_actor_sp(actor, x, y+64)
- draw_actor_exp(actor, x, y+96)
- end
- end
- end
- class Scene_Chapter_2
- def main
- @window_1=Window_1.new
- @window_2=Window_2.new
- @window_2.y=100
- @window_3=Window_3.new
- @window_3.x=200
- @window_3.y=100
- Graphics.transition
- loop do
- Graphics.update
- Input.update
- update
- if $scene != self
- break
- end
- end
- Graphics.freeze
- @window_1.dispose
- @window_2.dispose
- @window_3.dispose
- end
- def update
- @window_1.update
- if Input.trigger?(Input::B)
- $game_system.se_play($data_system.cancel_se)
- $scene = Scene_Map.new
- end
- end
- end
复制代码
你可以参考这段脚本 |
|