0 votes

Im trying to display some information in a label on different lines. Is this even possible?
Current code looks like this for one line:

$LumberHutButton/LumberHutInfo.text = "Cost: " + str(stepify(lumberCost, 0.01))

but I'd like it to look closer to this:

Cost: 5
DPS: 12/s
Other: 42

Is this even possible? Or im better of just making multiple labels and stacking them on top of each other?

in Engine by (15 points)

1 Answer

+2 votes
Best answer

You can use the \n newline character to add multiple lines:

$LumberHutButton/LumberHutInfo.text = "Cost: 5\nDPS: 12/s\nOther: 42"

You can also use multiple stacked labels within a VBoxContainer of course.

by (27,902 points)
selected by
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.