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

Forcing a line break with draw_text_ext for strings without spaces?

T

tamation

Guest
I have a system in place right now where the player can type out a string, it reads the keyboard_string input and draws it with draw_text_ext, with the width set to the length of the textbox.

It works great, except for when it's spammed with a string with no spaces, then the line break doesn't occur, even after the width has been exceeded. I've tried storing the width of keyboard_string as another variable and checking to see if it's hit the textbox amount in pixels, and then adding a line break manually to the string in the character after it does, but that didn't give me any noticeable results.

Is there something simple I'm missing here or is there no easy way to do this?
 

obscene

Member
The solution you tried is what should work, so maybe you messed up? I guess you would insert the string "\n" at some location if it's over that length.
 
Top