| 
 
| 赞 | 0 |  
| VIP | 0 |  
| 好人卡 | 0 |  
| 积分 | 2 |  
| 经验 | 4841 |  
| 最后登录 | 2018-3-30 |  
| 在线时间 | 677 小时 |  
 Lv1.梦旅人 饕餮 
	梦石0 星屑222 在线时间677 小时注册时间2011-5-9帖子486 | 
| 自己再改改吧~LZ应该能看懂吧复制代码#==============================================================================
# ■ Window_PlayTime
#------------------------------------------------------------------------------
#  メニュー画面でプレイ時間を表示するウィンドウです。
#==============================================================================
class Window_PlayTime < Window_Base
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #--------------------------------------------------------------------------
  def initialize
    super(0, 0, 160, 130)
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh
  end
  #--------------------------------------------------------------------------
  # ● リフレッシュ
  #--------------------------------------------------------------------------
  #--------------------------------------------------------------------------
# ● 刷新
#--------------------------------------------------------------------------
def refresh
  self.contents.clear
  time = Time.now
  text = time.strftime("%Y年%m月%d日")
  text1 = time.strftime("%H点%M分%S秒")
  text2 = time.strftime("星期" + ["日", "一", "二", "三", "四", "五", "六"][time.wday])
  self.contents.font.color = text_color(1)
  self.contents.draw_text(4, 0, 120, 20, text, 1)
  self.contents.font.color = text_color(1)
  self.contents.draw_text(4, 32, 120, 20, text1, 1)
  self.contents.font.color = text_color(1)
  self.contents.draw_text(4, 56, 120, 20, text2, 1)
  @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 = text_color(1)
  self.contents.draw_text(4, 82, 120, 20, text, 1)
end
  #--------------------------------------------------------------------------
  # ● フレーム更新
  #--------------------------------------------------------------------------
  def update
    super
    if Graphics.frame_count / Graphics.frame_rate != @total_sec
      refresh
    end
  end
end
 | 
 评分
查看全部评分
 |