4.3
Hi.
I’m creating a message system in my game, but cannot get any new line functionality. The idea is the player walks inside an Area2D that has a script with an empty array of strings, so I can add elements with custom text inside the editor and display the text in a rich text label.
I have bbcode enabled, and adding tags like [color] etc works fine, but the \n tag doesn’t work (it writes “\n” as part of the text). Can anyone help?
Could you paste your script? \n
shouldn’t be a tag, within a script \n
should produce a new line, how are you assigning the RichTextLabel’s text?
Yeah after further reading, I’ve found out that \n only works when writing a string in code and doesn’t work in the inspector. I wanted to write my text in elements of an exported array through the inspector and the text fields wouldn’t allow me to press enter to create a new line, but have since discovered that you can use @export_multiline to give you an expanded text field.
1 Like