Custom Font
peterraad
Member Posts: 56
Hello Im trying to make a custom font score for my game and im using gamsaladcookbooks method to do it and the game is running but my image isnt showing up.... its just a rectangular square please help
Comments
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
Open the Debugger window and when that portion of the code runs see what it evaluates to. Then check to see that your image filename is the same. The ".png" should be optional.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
If it is displaying score_nan then your code is not working. The code you posted looked okay at first glance... do you want to either post an actual screenshot or send me a link to download the project file (first compress it as a .zip file and then upload it to a filesharing service such as Dropbox or Mediafire)? If so, I can take a look and let you know why it's not working.
On a Mac, I use Spotlight to do quick calculations to see if my code should work. For example, since your expression is:
floor((game.Score%self.Divider)/(self.Divider/10))
You could enter*:
floor((105*100)/(100/10))
This results in 1050, so I would expect to have an image file named 1050.png in my file. That doesn't make much sense as far as a custom font is concerned so hopefully you get better results!
[*I assumed 100 for your self.Divider value but you should enter whatever your actual value is; I also assumed 105 for your game.Score value but you should enter actual possible score values and test a few to see what result you get.]
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Also, your game.Score attribute jumps all over the place. I'm not sure if you intended it that way, but after I shoot an enemy, it quickly goes down several times. I added a DisplayText actor with game.Score so I could watch it.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User