class Counting_Clock < Window_Base
def initialize
t = Time.now
q = t.sec
m = q + 5
$counting_clock=0
case q
when m
$counting_clock=30
super(240, 160, 120, 120)
self.contents = Bitmap.new(width-32, height-32)
self.contents.font.name = "Arial"
self.contents.font.size = 24
refresh
else
$counting_clock=0
super(240, 160, 120, 120)
self.contents = Bitmap.new(width-32, height-32)
self.contents.font.name = "Arial"
self.contents.font.size = 24
refresh
end
end # end initialize
def refresh
self.contents.clear
self.contents.font.color = normal_color
self.contents.draw_text(30, 25, 100, 32, $counting_clock.to_s)
end
end # end class
unfortunately this displays only the else result, in this case, "0". It doesn't auto update and the window closes automatically after a few seconds.