How do I Extend the Front of a Sprite Font

Get help using Construct 2

Post » Mon May 26, 2014 9:16 am

Hey there,
I am trying to recreate that typical score board you see in a lot of arcade games. Specifically where the score starts at and displays, 000,000,000. Then as the player gets more points lets say 12500. The new score would be displayed like this, 000,012,500.

Any know how to implement this? Thank You.
Last edited by Tekniko on Mon May 26, 2014 9:17 am, edited 1 time in total.
B
56
S
15
G
13
Posts: 826
Reputation: 17,645

Post » Mon May 26, 2014 9:53 am

From the manual

zeropad(number, digits)

Pad number out to a certain number of digits by adding zeroes in front of the number, then returning the result as a string. For example, zeropad(45, 5) returns the string "00045".


zeropad(score,5) would show the variable score with 5 0's infront
B
46
S
23
G
7
Posts: 459
Reputation: 6,763

Post » Mon May 26, 2014 10:50 am

Works great! Thanks!
B
56
S
15
G
13
Posts: 826
Reputation: 17,645


Return to How do I....?

Who is online

Users browsing this forum: guannstar, odiusfly and 24 guests