0 votes

I'd like to have a colorpicker in my project, but only for the hue, and not brightness, saturation, raw, etc.. Is there a way to do this? Or do i have to make my own node?

in Engine by (15 points)

1 Answer

0 votes
Best answer

I'm not sure exactly what parts of the ColorPicker control you want to keep and what parts you want to remove. However, the control is made up of other, standard Godot GUI components. You can step through the components via get_children() calls to find out how the control is constructed.

From there, you can simply hide the parts you don't want to see (via <control>.visible = false).

Here's a quick hack that'll step through a control and dump out all of its children. It'll call itself recursively on any container node...

func recurse_get_children(ctrl):
    for child in ctrl.get_children():
        if child is Container:
            print("> ", child)
            recurse_get_children(child)
        else:
           print("    ", child)

You could pass your color picker into that to get a better understanding of its construction. So, something like:

recurse_get_children($ColorPicker)

Using the info you get back, you can selectively hide parts of the ColorPicker as needed.

by (13,682 points)
selected by
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.