+1 vote

In the object inspector I can change color separately the taken Label.
enter image description here

But I don't see a method to do that in GDScript. Tell me how to do it in GDScript.

in Engine by (361 points)

1 Answer

+4 votes
Best answer
label.add_color_override("font_color", Color(1,0,0,1))
by (9,796 points)
selected by

Is it safe to call this multiple times? The add naming confuses me :s
Also, how can I get this color? When I use get_color("font_color") it returns white instead of what I set in the editor...

how can we remove the color_override?


var color = get_node("Label").get("custom_colors/font_color")   


get_node("Label").set("custom_colors/font_color", null)
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 Frequently asked questions and 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 [email protected] with your username.