Added scripts
This commit is contained in:
parent
d40ae86ba4
commit
5118df09f4
106 changed files with 15680 additions and 0 deletions
40
scripts/Window_PlayTime.rb
Normal file
40
scripts/Window_PlayTime.rb
Normal file
|
@ -0,0 +1,40 @@
|
|||
#==============================================================================
|
||||
# ** Window_PlayTime
|
||||
#------------------------------------------------------------------------------
|
||||
# This window displays play time on the menu screen.
|
||||
#==============================================================================
|
||||
|
||||
class Window_PlayTime < Window_Base
|
||||
#--------------------------------------------------------------------------
|
||||
# * Object Initialization
|
||||
#--------------------------------------------------------------------------
|
||||
def initialize
|
||||
super(0, 0, 160, 96)
|
||||
self.contents = Bitmap.new(width - 32, height - 32)
|
||||
refresh
|
||||
end
|
||||
#--------------------------------------------------------------------------
|
||||
# * Refresh
|
||||
#--------------------------------------------------------------------------
|
||||
def refresh
|
||||
self.contents.clear
|
||||
self.contents.font.color = system_color
|
||||
self.contents.draw_text(4, 0, 120, 32, "Play Time")
|
||||
@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
|
||||
#--------------------------------------------------------------------------
|
||||
# * Frame Update
|
||||
#--------------------------------------------------------------------------
|
||||
def update
|
||||
super
|
||||
if Graphics.frame_count / Graphics.frame_rate != @total_sec
|
||||
refresh
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue