• 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!

"Width" in "draw_text_ext" is scaling differently

Boxberg

Member
in 2560x1440 the text reaches the ideal position before wrapping to the next line. As the resolution goes down the wrapping largely moves to the left.
800600.png

800x600 the text wraps around 1/4 of the width. This is at the extreme, but it's even noticeable at 1920x1080.
25601440.png

Everything else conforms to the resolution of the screen. This is the code with the "draw_text_ext_transformation" being at the bottom and the "boxpos" being the width of how far the text will travel. boxpos uses display_get_width().
GML:
var size = myheight/2 * (1/20)
var sizew = mywidth/2 * (1/40)
var scaley = size / string_height("A")
var scalex = sizew / string_height("A")
var boxpos = (mywidth/2)
var might = (myheight/2)
//Draw message box        x, y(-/+ 160), w, h(-/+ 160), sprite, subim
draw_nineslice(0, myheight/3, mywidth/2, myheight/6, medude, 0);


//Draw Portrait        subim                h(+/- Sprite H)
draw_sprite(portrait, portrait_index, boxpos/16, might/14*4);

//-----TEXT
draw_set_font(font);

//Draw Name
var c = name_text_col;
draw_text_transformed_color(boxpos/16, might/16 * 11, name, scalex, scaley, 0,  c,c,c,c, 1);


//Draw Text MUST FIX THIS
draw_text_ext_transformed(boxpos/16, might/16 * 12, text[page], text_height, boxpos/16*14, scalex, scaley, 0);
I thought that resizing of the xscale and yscale of the letters were messing it up, but no matter how large or distorted I make it, it always wraps at the right position. It's only off when I start to lower the resolution. I'm only worried about the position in which the text wraps and I haven't been able to use "draw_text_ext" to my liking. Does anyone have a good solution to make the text-wrap conform to different resolutions in the same way the rest of my assets do?
 

Attachments

Boxberg

Member
Are you supposed to be dividing sizew by the HEIGHT of "A" rather than the width?
Hello TheouAegis,

It looks better to me when I do it by the width, but I have used the regular draw_text_ext to see if omitting the xyscales would change the result. The wrapping issue stayed the same.
 
Top