0

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?

MrZantoid
  • 13
  • 1
  • 1
    Welcome to StackOverflow, please share a [Minimal, Reproducible Example](https://stackoverflow.com/help/minimal-reproducible-example) so we can help you better. In your specific case you can share an image so anyone can understand what you're trying to do – Pietro Nadalini Aug 27 '21 at 03:04

1 Answers1

1

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
Partin23
  • 71
  • 4
  • @MrZantoid I'm happy it worked! If it answered your question I'd be happy if you could accept the answer :) – Partin23 Aug 31 '21 at 19:40