ColorPickerButton

继承: Button < BaseButton < Control < CanvasItem < Node < Object

A button that brings up a ColorPicker when pressed.

描述

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 Control.custom_minimum_size to a big enough value to give the button enough space.

属性

方法

主题属性


信号

color_changed ( color: Color )

Emitted when the color changes.


picker_created ( )

Emitted when the ColorPicker is created (the button is pressed for the first time).


popup_closed ( )

Emitted when the ColorPicker is closed.


属性说明

Color color = Color(0, 0, 0, 1)

  • void set_pick_color ( value: Color )
  • Color get_pick_color ( )

The currently selected color.


bool edit_alpha = true

  • void set_edit_alpha ( value: bool )
  • bool is_editing_alpha ( )

If true, the alpha channel in the displayed ColorPicker will be visible.


方法说明

ColorPicker get_picker ( )

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 CanvasItem.visible property.


PopupPanel get_popup ( )

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 Window.visible property.


主题属性说明

Texture2D bg

The background of the color preview rect on the button.

1

本方法通常需要用户覆盖才能生效。

2

本方法无副作用,不会修改该实例的任何成员变量。

3

本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。

4

本方法用于构造某个类型。

5

调用本方法无需实例,可直接使用类名进行调用。

6

本方法描述的是使用本类型作为左操作数的有效运算符。

7

这个值是由下列位标志构成位掩码的整数。

8

无返回值。