#==============================================================================
# ** Window_PlayTime
#------------------------------------------------------------------------------
# This window displays play time on the menu screen.
#==============================================================================
class Window_PlayTime < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(0, 0, 160, 64)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.font.color = system_color
@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", hour)
text2 = sprintf("%02d", min)
text3 = sprintf("%02d", sec)
self.contents.font.color = normal_color
self.contents.draw_text(0, 0, 90, 32, text3, 2)
self.contents.draw_text(0, 0, 95, 32, " ", 2)
self.contents.draw_text(0, 0, 60, 32, text2, 2)
self.contents.draw_text(0, 0, 65, 32, ":", 2)
self.contents.draw_text(0, 0, 30, 32, text, 2)
self.contents.draw_text(0, 0, 35, 32, ":", 2)
#self.contents.font.color = system_color
#self.contents.draw_text(0, 16, 70, 135, "Play Time", 2)
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
super
if Graphics.frame_count / Graphics.frame_rate != @total_sec
refresh
end
end
end