Image as score
mrtopz
Member Posts: 28
Hi!
I have an image that's 320x40 and has numbers from 0 to 9 and I want to use it as a score that will be shown one number at time (like a baseball score display). Is there some way to "move" this picture left or right to display the numbers on screen without showing the whole picture? Something like: "each time player 1 scores, move picture 40 pixels (area of each number in the picture) to the right" ?
Thanks!
I have an image that's 320x40 and has numbers from 0 to 9 and I want to use it as a score that will be shown one number at time (like a baseball score display). Is there some way to "move" this picture left or right to display the numbers on screen without showing the whole picture? Something like: "each time player 1 scores, move picture 40 pixels (area of each number in the picture) to the right" ?
Thanks!
Comments
As far as I'm aware, it's not possible to do exactly what you're asking. However, there is a very simple way to use graphics as a score if you have each of the numbers as a separate image file.
Create an actor, and a global variable for your score. Then, create a series of rules like this:
If score = 1, change image to 1.png
If score = 2, change image to 2.png
etc etc
Hope that helps!
-Jenna
I would break the 10 numbers up individually and switch them out when appropriate.
GS does not have masking, which is necessary to achieve what you mentioned.
@firemaplegames
I was trying to avoid breaking all images and call them individually. It's not very intelligent if you want to make a game heavily based on images (and I'd like to release to 1g iDevices) but if it's the only solution... Imagine this on a racer game in time trial / time attack mode, changing all image numbers?
Thanks for your help!
It is pretty much the standard around here for any sort of custom fonts.
As long as you don't have 5 scores at the same time all running 10 decimal places deep it's pretty efficiant on memory.
One thing to consider if you have a racer where you need time trials with numbers like 02m 24.564s
Is to just run it one decimal deep but have the full number display once you cross the finish line.
EDIT: Unless, of course... the score is a maximum of 9 ;-)
Thanks for the tip!
@ FireMapleGames
I think your customFonts demo will be used in another game...
@All
Thanks for the great help on this annoyng issue!