+1 vote
in Projects by (15 points)

3 Answers

+8 votes

get_node("Label").add_color_override("font_color", Color(1,0,0,1))

enter image description here

by (9,537 points)
+5 votes

Example

set("custom_colors/font_color",Color(1,0,0))

any parameter that doesn't have a direct getter or setter method can be accessed through
get(-the path hint you get when mousing over any parameter-)
e.g "custom_colors/font_color"

get() also needs a second parameter witch is what you want to change
e.g Color(1,0,0)

by (30 points)
edited by

Can you change a property of the color directly? e.g. the alpha? If so, how?

+1 vote

get_node("Label").set("custom_colors/default_color", Color(1,1,1,1))

The above would be white text.

by (16 points)

Thanks, this was very helpful. I assume things have been updated since 2017 as none of the other answers worked!

Thanks. It's a bit of trial and error sometimes. I'll try to contribute as much as I can. All the best!

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.

Categories