Main > Beta Testing

0 Padding On Clock Not Displaying

(1/2) > >>

If my understanding is correct, a clock format of MMSS should display time remaining with a leading 0 e.g. 09:00 with 9 minutes left in the level. I get 9:00. What am I missing?

Corey Cooper:
I think that all of the various tokens that display an elapsed amount of time were updated to follow this format ... except for the <clock> token.  Sadly (to me) I don't remember if this was intentional or an oversight.  All of the elapsed time tokens that have a format attribute use the same description text, so they all explain that you can specify the format in this way, but looking at the code it won't work for <clock>.

Thanks for the response, Corey. I use absolute positioning to place the clock on the screen and would like to show only minutes and seconds as our levels never exceed 30 minutes. Without the leading 0 the clock, obviously, jumps to the left at 9 minutes or less. By using the clock format and always showing hours, the clock maintains the correct positioning but I have to reduce font size to make it fit--but it does not fill the clock area the way I would like. Being an HTML novice I'm researching ways to solve the problem. So far, no luck but I'm not giving up yet.

Corey Cooper:
If you're left- or center-aligning then it will jump to the left once the clock drops to under 10 minutes.  But not if you right-align.  Of course, if your clock is supposed to be centered on the screen, it will be a little off-center once it gets below 10 minutes, but that might be better than shifting to the left.

I'm not sure how your layout is setup, but if you've got the clock in an absolutely positioned <div>, for example, then I would set the width of the div to the max size it would need to be (as many pixels wide as the clock would be at 30:00, for example), center it on the screen using the top and left styles, and set the text-align to right.

Did as you suggested except I set text-align to center and it seems to work pretty well. Still wish it showed leading zero when under 10 minutes (and under a minute) but--as the Stones said--You Can't Always Get What You Want!


[0] Message Index

[#] Next page

Go to full version