Image as score

mrtopzmrtopz Member Posts: 28
edited November -1 in Working with GS (Mac)
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!

Comments

  • ColorplayGamesColorplayGames PRO Posts: 69
    Hi mrtopz!

    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
  • firemaplegamesfiremaplegames Member Posts: 3,211
    On my wall I have a custom font example for the score, feel free to check it out.

    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.
  • mrtopzmrtopz Member Posts: 28
    @ColorplayGames
    @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!
  • JamesZeppelinJamesZeppelin Member Posts: 1,927
    The demo on FMG's wall is fantastic.
    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.
  • AfterBurnettAfterBurnett Member Posts: 3,474
    Yeah, I used it in my game... worked a treat!
  • AfterBurnettAfterBurnett Member Posts: 3,474
    ColorplayGames said:
    Hi mrtopz!

    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

    That won't work. Well, technically it would but you'd need a rule for every single possible score in the game! That's a lot of rules... also, you couldn't split the numbers up as they'd all read the same.

    EDIT: Unless, of course... the score is a maximum of 9 ;-)
  • mrtopzmrtopz Member Posts: 28
    @JamesZeppelin

    Thanks for the tip!

    @ FireMapleGames

    I think your customFonts demo will be used in another game... :D

    @All

    Thanks for the great help on this annoyng issue!
Sign In or Register to comment.