Multiple Custom Fonts for Score
Hi all, Happy December! How did it get here?!
A quick question, Ive used the awesome tutorials suggested on here for creating a custom number font - works a treat! Until, I want to add another custom font for a different themed set of levels.
The problem occurs when I import the second set of 0-9 images, and I cant have them named "0.png" etc, because those names are already in use.
I attempted to alter the Constrain Attribute to show an extra character before the file extension ('i' in this example to relate to the 2nd themed world)
floor((tableCellValue( game.tblLevelAttributes ,1, game.Level )% self.div )/( self.div /10)).."i.png"
and I also then named the new set of numbers 0i.png, 1i.png, 2i.png etc.
I wasnt hopeful that the above would work, and the fact Ive made this post is evident that it didnt
Any tips or advise as to if this is possible, somehow?
Please let me know if you need any extra info on how Ive programmed the rest...
Thanks, as always!
Comments
Just add to the text extension so name the new font 1t.png so in the expression do "t.png" and you're all set.
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
Yea I've done the same thing but not using tables I just used "B.png" I see you did that not sure why it's not working for you. Unless it's a table issue.
Give them another name !
Like Cheese_0.png or Font versionB 0.png . . . etc
. . . 'it didn't work' isn't very useful, saying what does happen is much more useful (the first number displays but never increments, no number displays at all, it displays the other font, it displays the extension and you don't want that, the image flickers rapidly between two values, it sticks after one cycle . . . etc.)
(side note: you don't need the .png part)
From what I can tell your code should work just fine.
oh yeah that was the old method but do we need it now that GS supports other image types?
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
@BBEnk - Cool, well thats a good start, knowing that it can be done that way. :-D
It just means that Ive not done something else correct somewhere along the way. (the joys of only have a few months experience in GS)
The table is just used to pull in a 'goal' for the specific level, so it shouldn't have any affect on the font naming.
@Socks - Thanks, I'll try naming them with a different prefix if thats possible. I was under the impression that the name had to be exactly what the number was, nothing more. (On the side note - thats one thing I did know, I just put the file extension on for what seemed like better clarity )
I'll try the above first, and then explain in more detail if it 'doesn't work'
Thanks chaps!
So, I could save the second set of images as .jpg? Or have I completely misunderstood...
I can't remember what all the new imaging support is. I only use PNG and @RP does all our art.
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
I wasn't suggesting you need to rename your files (although you can of course do that) I was saying that you don't need to include the extension in the expression.
Example, you have a numbered image sequence that runs . .
Image_1.png . . . . Image_2.png . . . Image_3.png . . . Image_4.png . . . etc
. . you can constrain it to the score like this:
constrain image to "Image_"..game.score
. . instead of this:
constrain image to "Image_"..game.score..".png"
@Socks So, if renamed the new images to 'new_0', 'new_1' etc, how would I alter my expression? Like this:
"new_"..((tableCellValue( game.tblLevelAttributes ,1, game.Level )% self.div )/( self.div /10))_
If there is a tutorial you can recommend that might help me understand easier, please point me in the right direction
Yes ! "new_".. and then whatever you have controlling the number.
I'm not aware of anything beyond the usual 'custom score font' videos on Youtube ?
All sorted!! For some reason, the original way I tried ('i.png') works now.. this happened after GS crashed from a image import! (luckily I ALWAYS save now before importing an image due to that reason)
Thanks for the other bits of advice, really appreciate it guys.... Im sure they will come in handy at some point