OS Time Demo - 12:00 shows 00:00
In the os time demo when the time hits 12:00 the time displays 00:00 does anyone know how to get it to display 12:00?
First Hour number is calculated by:
(floor(( game.Clock.Hour %12)/10))..".png"
Second Hour number is calculated by:
(( game.Clock.Hour %12)%10)..".png"
First Hour number is calculated by:
(floor(( game.Clock.Hour %12)/10))..".png"
Second Hour number is calculated by:
(( game.Clock.Hour %12)%10)..".png"
Comments
Basically the digital clock is showing 00:00 when it hits midnight/noon. You can change your Mac's system clock to 11:59 & wait a minute and see what I'm talking about. I want it to display 12:00 instead of 00:00. The demo is using these formulas to select a png who's name equals the formula values. e.g. if formula = 1 then 1.png will display.
First Hour number is calculated by:
(floor(( game.Clock.Hour %12)/10))..".png"
Second Hour number is calculated by:
(( game.Clock.Hour %12)%10)..".png"
I need to find a way that when the formula equals 00 to say select images for 1 and 2 not the 0.png images.
Thanks!
Hi @sawkastee Try something like the following; hopefully it should work although it's untested:
Make two text attributes, let's call them firstHt and secHt
In your first hour number actor's rules, put:
Constrain Attribute scene.firstHt to self.Image
Constrain Attribute self.Image to (floor(( game.Clock.Hour %12)/10))..".png"
Rule: When scene.firstHt = 0 and scene.secHt = 0
Change self.Image to 1.png
And in your second hour number actor's rules, put:
Constrain Attribute scene.secHt to self.Image
Constrain Attribute self.Image to (( game.Clock.Hour %12)%10)..".png"
Rule: When scene.firstHt = 0 and scene.secHt = 0
Change self.Image to 2.png
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
Make a new integer attribute called "self.TempNum"
timer every 1 second
--Change Attribute self.TempNum To: game.Clock.Hour %12
--When TempNum = 0
----Change Attribute self.TempNum To: 12
--Change Attribute self.Image To: (floor( self.TempNum/10))..".png"
That's it.
Edit: For the second number (the 2 in the '12') the last line is
--Change Attribute self.Image To: (floor( self.TempNum %10))..".png"