How do I make words stop jumping between lines?

I’m attempting to make a Game-boy esque RPG, top-down movement game. While implementing the dialogue box and the text itself, I noticed that, when a word gets big enough and doesn’t fit in the line, it jumps around awkwardly to the next line.

I want to find a way of making it so the line breaks happen more seamlessly, without any awkward line changes in the words. Be it by making it so the word only renders in the next line, or finding out a way of hyphening it when the character limit in a line is reached.

Please help me, as I think the awkward line breaks really mess up the immersion.

1 Like

I know what you’re talking about!
This thing can indeed break the immersion of your game…

What I personally do, is to manually add “new lines” before the word that will move to the next line. Basically just clicking enter. By doing so the extension types the words to the next line immediately as it knows from before where to position them.

Maybe the creator of the extension can see this post and update it? Not sure if they are active anymore.

1 Like

Hi! Thanks for trying to solve my issue :')
The problem is that I’m using Yarn for dialogue and I don’t think I can
add paragraphs without it assuming it’s a whole new dialogue line ( and subsequently waiting for the player input just to finish the phrase ). Maybe I’ll try and add spaces between the words I know are gonna get cut off, but I wish this had a smoother implementation, where we could choose a number of characters per line and if it reached that limit, the last word would be omitted, not even rendering in the wrong spot.

Thank you for your time & answer, it gave me a new idea to test out. Currently gonna check it out.

If anyone else has some input please feel free to write in this topic!

1 Like

Just tested the extra “space” solution and it seems it “fixes” the issue but creates another big one, which is the pacing of the sentence - it gets all slow when switching lines due to having to render each space before the next line. What a pain :sob:

1 Like

Ohhh you’re using Yarn! Truth is I never used it, but I was planning to at some point.

Are you creating new lines by clicking ENTER once, or by adding a lot of spaces by clicking SPACE? Cause a simple ENTER shouldn’t delay it that much. It’s just an input after all.

I’m gonna give yarn a try and see if there’s a way to solve it.

Actually where do you find Yarn haha…
I thought it was integrated in Gdevelop.

Unfortunately there’s no way to fix this. I’ve used Yarn for a while and in my game I have whole lines of dialogue appear because I don’t like the word wrapping behaviour when using the typewriter style. I have seen commercial released games, made in other engines, that also have that weird word wrapping, even in old PS2 games like Shadow Hearts. So it’s not something that bothers all developers, but I don’t think it looks good. This stops being an issue when you have whole lines appear - using DialogueTree::LineText() - but you lose that nice animation… it’s a pain! I have an opacity tween on my dialogue lines, so it still looks nice; whole lines fade in and out, like movie credits.

Yarn is integrated into GDevelop :slight_smile:

There are lots of conditions and actions for it. Search ‘dialogue’ when choosing a condition or action and you’ll see the available options with the little Yarn ball by them.

Loading a dialogue file (or creating a new one) can be done with this action, typically put in an ‘At the beginning of the scene’ event:
image
My dialogue file is called dialogue, but yours could be called whatever you like. If you use this action and you don’t have a dialogue file, you have the option to create a new one. And that’s where you get into the Yarn editor, where you actually put your dialogue:


There are Yarn tutorials on YouTube. Some of them by some bloke called worriedpixels.

2 Likes

Hi all!

I don’t know Yarn because i have no use for the moment but i have an idea to submit to you.
In classic code, you can, on PC system, add a CHR(10) (jump of lign) and CHR(13) (return) and the two if necessary.
Can’t you use this for trying to fix this Yarn issue?

A+
Xierra

Yarn dialogue is typed in lines in the Yarn editor, and a typical set-up would work like this in a game: (1) The systems shows the first line of dialogue, which may or may not wrap within the text object (text box), depending on how long the line of dialogue is and how wide the text object is (2) the player presses a button to see the next line (3) the first line disappears and the second replaces it. You can’t add line breaks within Yarn lines. If you wanted to avoid wrapping when using Yarn, you’d need to write short dialogue lines and make sure the text object is wide enough so that text doesn’t need to wrap.

So you can’t do things like poems, for example, in Yarn, where a paragraph of text is broken into lines that wrap exactly where you want them and the player sees the whole poem. Yarn would show you one line of the poem, one by one, and wrap any line that is too long for the text object.

You could add spaces to force words onto the lines below, but Yarn will process those spaces like any other characters and the player will experience this as a weird pause between lines, as andremeneses discovered.

2 Likes

It is regretable!

A+
Xierra