Skip to content

ColorButton ​

Inherits: MarginContainer

ColorButton - Button that displays and selects a color Used in character creation for skin, hair, and eye color selection

Properties ​

Colorbutton_colorColor.WHITE:
Colorborder_selected_colorColor(1.0, 0.843, 0.0)
Colorborder_unselected_colorColor(0.5, 0.5, 0.5)

Variables ​

boolselectedfalse:

Methods ​

voidset_color( color: Color )
Colorget_color()
voidset_selected( is_selected: bool )
voidtoggle_selected()

Signals ​

pressed() ​

Emitted when the button is pressed.

color_selected( color: Color ) ​

Emitted when the color is picked.

Property descriptions ​

Color button_color = Color.WHITE: ​

The color the button shows and picks.

Color border_selected_color = Color(1.0, 0.843, 0.0) ​

Gold

Color border_unselected_color = Color(0.5, 0.5, 0.5) ​

Grey

Variable descriptions ​

bool selected = false: ​

True when this is the color picked.

Method descriptions ​

void set_color( color: Color ) ​

Set the button's color

Color get_color() ​

Get the button's color

void set_selected( is_selected: bool ) ​

Set selected state

void toggle_selected() ​

Toggle selection state