How to enter a new line on a dialog?

Hello, we’ve been working on a game recently and we need help with the dialog. The game gives the possibility to the user to write inside a box and comunicate with the NPC.
We can’t find out how to break the line when the user is typing.
For example:
1 “Hello, welcome to the
2 Blender forum, enjoy
3 your stay.”

But our codes always end up like this:

1 “Hello, welcome to the Blender forum, enjoy your stay.”

The only way we can break the line by now is pressing “Return” or “Enter”, we want to make it automatic. Is there anyway to make it possible using Python or the logic bricks? :eyebrowlift:

Hello back at you. Well, if you’re using bitmap text or Moguri’s BGUI module, then new lines can be expressed with the newline escape character ’
’ and will be interpreted as new lines. Otherwise, you can’t really do it. To do it with bitmap text or the BGUI module, you’ll set the text string to be what you want, with the new line characters where you need them to be. For example,

obj[‘label’].text = “Hello, welcome to the
Blender forum, enjoy
your stay.”

Actually, I think I’ve expressed myself wrong. What I meant was the following:

Imagine you are typing a text, like in a simple text editor program. When you get to the end of the line, it jumps to the next line automatically. Our problem is that we can’t make it happen.

Thanks.

Firstly, look up Bitmap fonts.
Then, use some code that get’s the length of the text, and if it is larger than the full length, add a "
"
e.g
if object[“Text”] >3:
object[“Text”] += "
"

It wouldn’t quite work as it would keep adding "
" but i’ll think of a better solution

You would need to make a duplicate of the string, checking from the beginning of the string. If the length of that duplicate string exceeds a certain number, add a newline character, and push up where you’re checking the string from.