using a spritesheet for numbers/letters

I’ve been trying to think about this one for months, and the best idea I have is maybe using a showani or somehow rigging it with vars and showimgs.

Is this a proper approach, or is there a better way? I can do this, I just wanted to know the best possible approach before I fuck myself up later.

lol no ones here 2 do it 4 u do it urself beter off lerning lmao n00b

I clearly wasn’t asking for someone to do it for me, I was asking for advice.

say the numbersheet looks like:
0 1 2 3 4
5 6 7 8 9

then

if (number < 5) {
  showimg 300,numbers.png,x,y;
  changeimgpart 300,#v(number)*16,0,12,12; //12px font with 4px spacing
} else if (number >= 5) {
  showimg 300,numbers.png,x,y;
  changeimgpart 300,(#v(number)-5)*16,16,12,12;
}

Pretty much the idea.

that was what I thought, but what happens if the number is over 10? I can’t figure out a way to make it work…

for loop and #e

hmm okay I’ll piece it together later. Thanks for the help.

What image are you using for numbers?

haven’t made it up yet, but I was going to make it myself, since I thought custom numbers for something I wanted to mess around with would be nicer than regular text.

if (playerchats) {
  hideimgs 300,400;
  b = strlen(#c);
  for (i=0;i<b;i++) {
   showimg 300+i,pics1.png,(x-(b/2))+i,y;
    if (strtofloat(#e(i,1,#c)) < 5) {
      changeimgpart 300+i,strtofloat(#e(i,1,#c))*16,0,16,16;
    } else if (strtofloat(#e(i,1,#c)) >= 5) {
      changeimgpart 300+i,(strtofloat(#e(i,1,#c))-5)*16,16,16,16;
    }
  }
}

jesus, I can’t even read that. (it’s been so long since I’ve scripted it’s not even funny.)

I just edited it. Moved some stuff around to make it neat.

Looks nicer :slight_smile: