+2 votes

Hello Everyone,

I have been looking through the documentation for a way to change the color of UI controls and found the Theme.setcolor() method. But, I cannot find a list of the colors that I can change; I only know of 'fontcolor', which was used in the example.

So my questions are:
1. Is setting a control's Theme the best/only way to set a control's color?
2. Where can I find a list of the colors that I can change using Theme.set_color()

Thanks for helping the new guy.

in Engine by (80 points)

1 Answer

+1 vote
Best answer

Creating a theme is good because it's an easy way to make a coherent... well theme... for all UI elements.

Color is actually a class. Check the docs here. You have different ways to create your color.

by (372 points)
selected by
Thank you, that answers my first question.
Do you know where the list of names and types are that can used to call the Theme.set_color() method?

set_color ( String name, String type, Color color )
I haven't used themes myself yet but I just had a quick look at the docs and they say that `name` is the name of the property you want to set. So for example if you want to change a button just check all of the propoerties the button class has. Type is the name of the control, so for example "Button".

http://docs.godotengine.org/en/latest/tutorials/2d/gui_skinning.html

Also here is the docs page for Control. I think all GUI controls inherit from this base node, so you can just click on them to see all their properties.

http://docs.godotengine.org/en/latest/classes/class_control.html
Perfect, now I understand. Thanks!
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.