[Solved] Line break character in string

Hi!

My question is about something very basic… but by now I had tried a lot of things and I’m starting to feel I’m missing something.

How can I add a line break character to a string?

The final intention is to load custom text in a variable string and then display it in a text object as a paragraph.

The standard for C++ and Java, “/r/n”, is not working and GD is displaying it as part of the text.

Thanks in advance :neutral_face:

/Edited:

Try “\n” which is the real standard.

Yeah, you’re right about the backslash but you know the standard usage of the carriage return character is defined by the operating system you’re programming for, right? So if you’re programming only for Microsoft systems, then yes, I guess “\n” is the real standard, but that will not work on many linux-based operating systems, and I had to say it’s a bit strange for me to call standard to something that it’s universally avoided in sake of a better combination of characters because it don’t works for a whole gama of operating systems.

Anyways…

Thanks @victor but by now I had tried:

“\n”

“\r”

“\r\n”

“/n”

“/r”

“/r/n”

… and, real or not real, nothing works… :neutral_face:

"This is my string" + NewLine() + "with a carriage return"

NewLine is a function like any other, so you can find it in the list of functions in a text editor (category Manipulation on text).

By the way, the only espaced character in Game Develop is " (which is used to delimit strings, so you can insert a quote in a string by typing ").

Hallelujah! Thanks @4ian