LoginLogin

Placing multiple sprites in a row

Root / Programming Questions / [.]

OhBoyCreated:
So for a dating simulator game I had worked on for valentines day, I decided to make a custom font for the game. Seeing that font tiles were too small for my font, I had created them as sprites instead. My code looks a bit like this:
SPSET 13,72
SPOFS 13,10,156,-100
SPSET 14,69
SPOFS 14,18,156,-100
SPSET 15,76
SPOFS 15,26,156,-100
SPSET 16,76
SPOFS 16,34,156,-100
SPSET 17,79
SPOFS 17,42,156,-100
Is there a way to place multiple sprites in a row more efficiently? Also, is there a way to use larger fonts on the font page?

You could make this code smaller by using FOR loops:
'Set up sprites
SPSET 13,72
SPSET 14,69
SPSET 15,76
SPSET 16,76
SPSET 17,79

'Put sprites in correct place
FOR I=0 TO 4
 SPOFS I+13,10+(I*8),156,-100
NEXT I
If you want larger fonts, you can use the GPUTCHR command, like this:
GPUTCHR 0,0,"BIG TEXT!!!",2,2,#WHITE
GPUTCHR 0,32,"WIDE TEXT!!!",2,1,#WHITE
GPUTCHR 0,64,"TALL TEXT!!!",1,2,#WHITE

If you want a different font, use Font Edit or FONTDEF