Skip to content
0.2.0-dev Download ZIP
66 lines ·3.2 KB Raw
1<?xml version="1.0" encoding="UTF-8" ?>
2<class name="ColorPickerButton" inherits="Button" api_type="core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
3 <brief_description>
4 A button that brings up a [ColorPicker] when pressed.
5 </brief_description>
6 <description>
7 Encapsulates a [ColorPicker], making it accessible by pressing a button. Pressing the button will toggle the [ColorPicker]'s visibility.
8 See also [BaseButton] which contains common properties and methods associated with this node.
9 [b]Note:[/b] By default, the button may not be wide enough for the color preview swatch to be visible. Make sure to set [member Control.custom_minimum_size] to a big enough value to give the button enough space.
10 </description>
11 <tutorials>
12 <link title="2D GD Paint Demo">https://godotengine.org/asset-library/asset/2768</link>
13 <link title="GUI Drag And Drop Demo">https://godotengine.org/asset-library/asset/2767</link>
14 </tutorials>
15 <methods>
16 <method name="get_picker">
17 <return type="ColorPicker" />
18 <description>
19 Returns the [ColorPicker] that this node toggles.
20 [b]Warning:[/b] 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 [member CanvasItem.visible] property.
21 </description>
22 </method>
23 <method name="get_popup">
24 <return type="PopupPanel" />
25 <description>
26 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.
27 [b]Warning:[/b] 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 [member Window.visible] property.
28 </description>
29 </method>
30 </methods>
31 <members>
32 <member name="color" type="Color" setter="set_pick_color" getter="get_pick_color" default="Color(0, 0, 0, 1)" keywords="colour">
33 The currently selected color.
34 </member>
35 <member name="edit_alpha" type="bool" setter="set_edit_alpha" getter="is_editing_alpha" default="true">
36 If [code]true[/code], the alpha channel in the displayed [ColorPicker] will be visible.
37 </member>
38 <member name="edit_intensity" type="bool" setter="set_edit_intensity" getter="is_editing_intensity" default="true">
39 If [code]true[/code], the intensity slider in the displayed [ColorPicker] will be visible.
40 </member>
41 <member name="toggle_mode" type="bool" setter="set_toggle_mode" getter="is_toggle_mode" overrides="BaseButton" default="true" />
42 </members>
43 <signals>
44 <signal name="color_changed">
45 <param index="0" name="color" type="Color" />
46 <description>
47 Emitted when the color changes.
48 </description>
49 </signal>
50 <signal name="picker_created">
51 <description>
52 Emitted when the [ColorPicker] is created (the button is pressed for the first time).
53 </description>
54 </signal>
55 <signal name="popup_closed">
56 <description>
57 Emitted when the [ColorPicker] is closed.
58 </description>
59 </signal>
60 </signals>
61 <theme_items>
62 <theme_item name="bg" data_type="icon" type="Texture2D">
63 The background of the color preview rect on the button.
64 </theme_item>
65 </theme_items>
66</class>