06-09-2012, 07:57 AM
(This post was last modified: 09-02-2024, 10:04 PM by DerVVulfman.)
Bump!
Wheee.
Updated the script with a major addition that makes working out the complete sprite's length much more sensible. Or to put it another way, I just learnt about String.length. |V In addition, numbers with leading zeros like playtime hour/min/sec should be able to be used with this script.
Wheee.
Updated the script with a major addition that makes working out the complete sprite's length much more sensible. Or to put it another way, I just learnt about String.length. |V In addition, numbers with leading zeros like playtime hour/min/sec should be able to be used with this script.
Code:
hour = sprintf("%02d", @total_sec / 60 / 60)
min = sprintf("%02d", @total_sec / 60 % 60)
sec = sprintf("%02d", @total_sec % 60)
draw_bitmap_number(sec, self.width - 44, y + LINE_HEIGHT, 0, 2)
draw_bitmap_number(min, self.width - 84, y + LINE_HEIGHT, 0, 2)
draw_bitmap_number(hour, self.width - 124, y + LINE_HEIGHT, 0, 2)