So the other day I got bored of using standard font for numbers in displays. I thought using sprites for the numbers would make it much more versatile, and I think real games do that most of the time anyway. So the other night I took five minutes to come up with this, someone else may have already done it, but I haven't seen it.
First, make a sprite with 11 images, zero through 9, and a blank square. Now, decide on the largest number you want to draw and make variables accordingly. For example, I did 999, and in the create event I had Hundreds = 0, Tens = 0, and Ones = 0.Now, get a number. I just did something where I clicked on the box and typed a number, but it could be any numerical variable. Do an if statement to make sure your variable is less than the largest number you planned for.Do a series of floor functions to break that variable into its digits.Hundreds = floor(Number/100)
Tens = floor((Number-(Hundreds*100))/10)
Ones = floor(Number-(Hundreds*100)-(Tens*10))
HundredsImage = Hundreds
TensImage = Tens
OnesImage = Ones
if Hundreds = 0{
HundredsImage = 10
}
if Hundreds = 0 && Tens = 0{
TensImage = 10
}
if Ones = 0 && Tens = 0 && Hundreds = 0{
OnesImage = 10
}
You could just use the font_add_sprite function.
Shork just got owned.
Yep.
HAHAHAHA, nice thoughXD
GM letters are ugly :p
Or you could use the fun method. Besides, this method of splitting numbers into their digits may have other uses.
I WOULD SAY THIS :
"What is a Shork…? Answer my question or BE TALKED TO EVEN MORE THAN I ALREADY INTEND ON SPAMMING YOUR BLOG LIKE THIS :" Hi. "I HAVED SPOKEDN ABOUT IT"But instead… I SAY THIS : " Hi. Actually I already knew how to do this. DOES THAT MAKE ME SMART? PLEASE ANSWER. "Nods then might escape.What is a Shork? Shork is the Lord of Madness, the King of Chaos, the Destroyer of the Damned, and the Damner of the Destroyed! Shork will tear open your chest with his mind and consume the shrivled lump you call a soul!
Hope you know I didn't mean any disrespect :)