+1 vote

I'd like to click text in a meta tag and have the contents be selected/highlighted like you would if you manually dragged your mouse to select the whole string. How can this be done?

in Engine by (44 points)

I'm not sure if this helps, but I'm pretty sure labels and other UI nodes in Godot are incapable of this. But I think if you have a TEXTEDIT node then it's possible. The only downside is having your characters be able to edit the text. But then again, why would you want a player to highlight a text if it's not to be edited?

1 Answer

0 votes

Assuming you're talking about a RichTextLabel, the only way I see it is have the on_meta_clicked method connected to that signal, replace the bbcode between that [url] tag, with the same text, but wrapped with the extra bbcode tag you need. E.g. you could turn it underlined or change the font colour. Unfortunately the node does not offer a native way to change font background, but you can develop a custom effect to do that youself.

by (77 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.