Score system with bitmaps

Hello

I’m making a score system for my game and thinking about using PNG images instead of a font.

I made different images for each different number(0,1,2,3,4,5,6,7,8,9). The tricky part is showing the proper image based on the number.
ex: After 9 it should replace the first number by 1 and put a 0 next to it, etc…

I’m wondering is there any easy way to make it?

Thanks

i would convert the number to a string, that way you can easily find out about the ‘length’ of the number and each character of the string sperately

This would actually be a good place to use the modulo/modulus operation. I’m rushing out at the moment, but the gist of it is:

You’ll find each digit of the score (going right to left) by finding

score % (10^n)

where n simply loops through from 1 to however many digits you need.

From here, just display the appropriate png per digit.

You can also check these threads:

http://forum.unity3d.com/viewtopic.php?t=44389&highlight=

http://answers.unity3d.com/questions/4461/how-to-implement-an-ammo-counter-using-textured-quads-scripting-doubts

Thanks for the answers they helped a lot. Each digit is a different draw call if you have 4 digits that means it will use 4 draw calls. Most probably there is a better way to do it, but it works fine on iphone. No problems at all. If you want to use it in your project you can ask me and I’ll send you the file. Thanks again