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

GameMaker Insert line break

C

Carlos PT

Guest
I'm trying to create a textbox that reads a string and shows it. I need to make it so it can jump to the next line if the string is longer than the box. I have followed a tutorial that uses the symbol "#" to insert line breaks manually. My problem is this is not working using GMS2 (the tutorial is in 1.4). Trying this it writes the symbol itself, instead of creating a line break. How can I insert a line break manually in GMS2? Is there another symbol? Thanks in advance.
 
  • Like
Reactions: Mut

sylvain_l

Member
you now that if you want to draw a text in a box, there is a function that handle the wraping for you ?
draw_text_ext()

(of course don't mind my saying if you are just doing it yourself for learning, handling wrapping is a good little exercice)
 
Sorry for adding to an old post but I didn't know if this would be better than starting a new one. Correct me if my etiquette is wrong.

I'm using the draw font extended function. The wrapping works but only if there is a space. For example limit of 5 characters with spaces works like this:-

12345 (space)
12345 (space)

So that is fine.

No space shows like this 1234512345

I need it to go to a new line if the limit is reached.
 

sylvain_l

Member
No space shows like this 1234512345

I need it to go to a new line if the limit is reached.
the GMS function only insert linebreak at white space char; and will let the char overrun the limit if no white space are present. If you want to force break into words you'll have to handle it yourself (create your own function to do it).
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
Sorry for adding to an old post but I didn't know if this would be better than starting a new one. Correct me if my etiquette is wrong.
Hello! Just want to reply to this since you were kind enough to ask. In general posting in another topic is called "hijacking" a topic, and isn't something we like to see, and posting in a topic that has no reply after six months or more we call "necro-bumping".... so, yeah, you've been baaaaaaaaad. :p

Seriously, though, it's not a big deal, but we'd much prefer you make new topics for issues, even if they are related or similar to an issue that has been previously posted. It keeps things tidier and makes the forum a better resource, as once your issue has been resolved, you can edit the topic title to add "Solved" to it and people will know that the topic could potentially offer them a solution to an issue they have too.
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
Sorry I won't do it again :(
That's fine, and it's not an issue. I appreciate you asking about the rules and etiquette! :)

Can I necro-bump something less than 6 months old?
Well, really, six months is just a general rule of thumb... and the answer to that would be "it depends". For example, if the topic is 4 months old, hasn't had a solution posted and you think you have a solution, then it might not be worthwhile posting, because the chances are that the original poster (OP) has moved on or resolved the issue for themselves. However, it may be that the problem was a particularly tricky one, or you think you have a smart resolution and it may be worth posting it for future users who search the forums to find. So in cases like this it's really up to you... I would say though, that you should never bump a topic that isn't yours just to say you are having the same issue, and it's much better to make your own topic.
 
Top