I would like to use original graphics instead of a font to display a score. I need to be able to deal with the ones, tens and hundreds places of the number separately. For the scripting I could say “if score is 5 or 15 or 25” etc, set ones place to the graphic for five, but there should be a more elegant and intelligent way to do, this saying instead “if the ones place is five” or “if the tens place is three” and so on. Does anyone know how to do this with scripting?
yeah… make a quicktime movie of your “graphic” numbers from 0 - 9… where each is on their respective frame.
Then if you need 5 digits for the score, you add 5x guiTextures next to each other using a version of the QT mov, and the logic goes… for each number in the score, cycle the correct digit to the correct frame.
That way, you can have whatever graphics you want in each frame to represent a digit, or even something like a slot machine… pinapples/bananas, or gems… etc
First off, I’d like to point out that this is fairly pointless, given that you can create your own font and do about anything you’d want to:
That said, you can use modulus to get a particular digit.
hundredsPlaceFrame = (score / 100) % 10;
tensPlaceFrame = (score / 10) % 10;
onesPlaceFrame = (score) % 10;
Hey, thanks for the tip on the Wiki font info. I think that will come in handy at some point, but right now the code you supplied actually IS what I want for what I am doing, and it’s also educational. So thanks for that too.