Class ColorPickerButton
- Namespace
- Godot
- Assembly
- GodotSharp.dll
Encapsulates a ColorPicker, making it accessible by pressing a button. Pressing the button will toggle the ColorPicker's visibility.
See also BaseButton which contains common properties and methods associated with this node.
Note: By default, the button may not be wide enough for the color preview swatch to be visible. Make sure to set CustomMinimumSize to a big enough value to give the button enough space.
public class ColorPickerButton : Button, IDisposable
- Inheritance
-
ColorPickerButton
- Implements
- Inherited Members
Constructors
ColorPickerButton()
public ColorPickerButton()
Properties
Color
The currently selected color.
public Color Color { get; set; }
Property Value
EditAlpha
If true
, the alpha channel in the displayed ColorPicker will be visible.
public bool EditAlpha { get; set; }
Property Value
Methods
GetPicker()
Returns the ColorPicker that this node toggles.
Warning: This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their Visible property.
public ColorPicker GetPicker()
Returns
GetPopup()
Returns the control's PopupPanel which allows you to connect to popup signals. This allows you to handle events when the ColorPicker is shown or hidden.
Warning: This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their Visible property.
public PopupPanel GetPopup()
Returns
HasGodotClassMethod(in godot_string_name)
Check if the type contains a method with the given name. This method is used by Godot to check if a method exists before invoking it. Do not call or override this method.
protected override bool HasGodotClassMethod(in godot_string_name method)
Parameters
method
godot_string_nameName of the method to check for.
Returns
HasGodotClassSignal(in godot_string_name)
Check if the type contains a signal with the given name. This method is used by Godot to check if a signal exists before raising it. Do not call or override this method.
protected override bool HasGodotClassSignal(in godot_string_name signal)
Parameters
signal
godot_string_nameName of the signal to check for.
Returns
InvokeGodotClassMethod(in godot_string_name, NativeVariantPtrArgs, out godot_variant)
Invokes the method with the given name, using the given arguments. This method is used by Godot to invoke methods from the engine side. Do not call or override this method.
protected override bool InvokeGodotClassMethod(in godot_string_name method, NativeVariantPtrArgs args, out godot_variant ret)
Parameters
method
godot_string_nameName of the method to invoke.
args
NativeVariantPtrArgsArguments to use with the invoked method.
ret
godot_variantValue returned by the invoked method.
Returns
Events
ColorChanged
Emitted when the color changes.
public event ColorPickerButton.ColorChangedEventHandler ColorChanged
Event Type
PickerCreated
Emitted when the ColorPicker is created (the button is pressed for the first time).
public event Action PickerCreated
Event Type
PopupClosed
Emitted when the ColorPicker is closed.
public event Action PopupClosed