赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 1 |
经验 | 160 |
最后登录 | 2014-5-1 |
在线时间 | 0 小时 |
Lv1.梦旅人 星
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 0 小时
- 注册时间
- 2008-6-10
- 帖子
- 678
|
- #==============================================================================
- # ■ Window_PlayTime
- #------------------------------------------------------------------------------
- # 菜单画面显示游戏时间的窗口。
- #==============================================================================
- class Window_PlayTime < Window_Base
- #--------------------------------------------------------------------------
- # ● 初始化对像
- #--------------------------------------------------------------------------
- def initialize
- super(0, 0, 160, 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)
- end
- #--------------------------------------------------------------------------
- # ● 刷新画面
- #--------------------------------------------------------------------------
- def update
- super
- if Graphics.frame_count / Graphics.frame_rate != @total_sec
- refresh
- end
- end
- end
复制代码
- #==============================================================================
- # ■ Window_Steps
- #------------------------------------------------------------------------------
- # 菜单画面显示步数的窗口。
- #==============================================================================
- class Window_Steps < Window_Base
- #--------------------------------------------------------------------------
- # ● 初始化对像
- #--------------------------------------------------------------------------
- def initialize
- super(0, 0, 160, 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, "步数")
- self.contents.font.color = normal_color
- self.contents.draw_text(4, 32, 120, 32, $game_party.steps.to_s, 2)
- end
- end
复制代码 |
|