• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

SOLVED 3 or 4 strings to fit in specific area

i have strings that should fit in an area
from 210 to 786 .
i would like to have 3 or 4 strings to scale to fit in this area.
the variables are called guest1, guest2, guest3 and guest4
all of these variables vary in string_width

how can i make these fit using draw_text_transformed?
 
Last edited:
as in (786-210)/(string_width(guest1)+string_width(guest2)+string_width(guest3))
and
draw_text_transformed(x,y,guest1+" "guest2.......)
?
 
heres what im using
var width, scale;
width = string_width(guest1)+string_width(guest2)+string_width(guest3)
scale = 1;

if (width > (786-210)) {
scale = (786-210)/width;
}


draw_text_transformed(210,y+40+(num*100),guest1+" "+guest2+" "+guest3,scale,1,0)

im getting a doAdd error
DoAdd :: Execution Error
 
i just added string() to all of it and it worked.

draw_text_transformed(210,y+40+(num*100),string(guest1)+string(" ")+string(guest2)+string(" ")+string(guest3),scale,1,0)

thanks again
 
Top