0 votes

Hello! I wanna display some simple text like in the Mario games. Something like this:

You get near an object or touch it and then some text in a box above appears. Then you press a button or get far away and it disappears.

What's the Node I should add? Richtextlabel? How can I script it to make it appear disappear? Any tutorials out there?

Thank you very much!

in Engine by (58 points)

1 Answer

+3 votes

Label or RichTextLabel can both work, depending on how much formatting you need in your text.

You can show/hide the box with the visible property.

For detecting proximity, use an Area2D. On the body_entered signal, show the box, and on body_exited hide it.

As for tutorials, while you might not find exactly this, there are many tutorials out there on using the individual components.

by (20,377 points)
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.