MrZantoid
MrZantoid

Reputation: 13

How to edit a previous line of a Label with a script in Godot

I need to add something to a label that's up on a line above an existing line with a script, how would I do that?

Upvotes: 0

Views: 1223

Answers (1)

Partin23
Partin23

Reputation: 81

The question is a bit vague but as I understand it you want to add a line of text above the existing text in a label.

Simply add "\n" where you want your text to have a line break and have the text after the line break be the original text of the label. For example:

var label = get_node("node_path")
label.text = "YOUR NEW TEXT\n" + label.text

Upvotes: 1

Related Questions