赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 1 |
经验 | 13512 |
最后登录 | 2022-5-16 |
在线时间 | 140 小时 |
Lv1.梦旅人 茄孓
- 梦石
- 0
- 星屑
- 72
- 在线时间
- 140 小时
- 注册时间
- 2007-5-29
- 帖子
- 956
|
把这个脚本放到main前就可以合起来了
- class Window_Steps < Window_Base
- def initialize
- super(0, 0, 160, 96)
- self.contents = Bitmap.new(width - 32, height - 32)
- self.opacity = 0
- self.back_opacity = 0
- refresh
- end
- def refresh
- self.contents.clear
- end
- end
- class Window_PlayTime < Window_Base
- def initialize
- super(0, 0, 160, 192)
- 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(4, 0+80, 120, 32, "步数")
- self.contents.font.color = normal_color
- self.contents.draw_text(4, 32+80, 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
复制代码 |
|