2017-09-13 04:42:36 +08:00
<?xml version="1.0" encoding="UTF-8" ?>
2020-02-01 09:03:48 +08:00
<class name= "Button" inherits= "BaseButton" version= "4.0" >
2017-09-13 04:42:36 +08:00
<brief_description >
Standard themed Button.
</brief_description>
<description >
Button is the standard themed button. It can contain text and an icon, and will display them according to the current [Theme].
</description>
<tutorials >
</tutorials>
<methods >
</methods>
<members >
2019-06-29 18:38:01 +08:00
<member name= "align" type= "int" setter= "set_text_align" getter= "get_text_align" enum= "Button.TextAlign" default= "1" >
2019-12-07 06:09:20 +08:00
Text alignment policy for the button's text, use one of the [enum TextAlign] constants.
2017-09-13 04:42:36 +08:00
</member>
2019-06-29 18:38:01 +08:00
<member name= "clip_text" type= "bool" setter= "set_clip_text" getter= "get_clip_text" default= "false" >
2019-08-29 10:12:22 +08:00
When this property is enabled, text that is too large to fit the button is clipped, when disabled the Button will always be wide enough to hold the text.
2017-09-13 04:42:36 +08:00
</member>
2019-08-21 00:41:14 +08:00
<member name= "expand_icon" type= "bool" setter= "set_expand_icon" getter= "is_expand_icon" default= "false" >
When enabled, the button's icon will expand/shrink to fit the button's size while keeping its aspect.
</member>
2019-06-29 18:38:01 +08:00
<member name= "flat" type= "bool" setter= "set_flat" getter= "is_flat" default= "false" >
2017-09-13 04:42:36 +08:00
Flat buttons don't display decoration.
</member>
2020-02-12 16:59:06 +08:00
<member name= "icon" type= "Texture2D" setter= "set_button_icon" getter= "get_button_icon" >
2017-09-13 04:42:36 +08:00
Button's icon, if text is present the icon will be placed before the text.
</member>
2019-06-29 18:38:01 +08:00
<member name= "text" type= "String" setter= "set_text" getter= "get_text" default= """" >
2017-09-13 04:42:36 +08:00
The button's text that will be displayed inside the button's area.
</member>
</members>
<constants >
2017-11-25 06:16:30 +08:00
<constant name= "ALIGN_LEFT" value= "0" enum= "TextAlign" >
2017-09-13 04:42:36 +08:00
Align the text to the left.
</constant>
2017-11-25 06:16:30 +08:00
<constant name= "ALIGN_CENTER" value= "1" enum= "TextAlign" >
2017-09-13 04:42:36 +08:00
Align the text to the center.
</constant>
2017-11-25 06:16:30 +08:00
<constant name= "ALIGN_RIGHT" value= "2" enum= "TextAlign" >
2017-09-13 04:42:36 +08:00
Align the text to the right.
</constant>
</constants>
<theme_items >
<theme_item name= "disabled" type= "StyleBox" >
2020-01-27 09:15:37 +08:00
[StyleBox] used when the [Button] is disabled.
2017-09-13 04:42:36 +08:00
</theme_item>
<theme_item name= "focus" type= "StyleBox" >
2020-01-27 09:15:37 +08:00
[StyleBox] used when the [Button] is focused. It is displayed over the current [StyleBox], so using [StyleBoxEmpty] will just disable the focus visual effect.
2017-09-13 04:42:36 +08:00
</theme_item>
<theme_item name= "font" type= "Font" >
2020-01-27 09:15:37 +08:00
[Font] of the [Button]'s text.
2017-09-13 04:42:36 +08:00
</theme_item>
2019-07-09 15:13:00 +08:00
<theme_item name= "font_color" type= "Color" default= "Color( 0.88, 0.88, 0.88, 1 )" >
2020-01-27 09:15:37 +08:00
Default text [Color] of the [Button].
2017-09-13 04:42:36 +08:00
</theme_item>
2019-06-29 18:38:01 +08:00
<theme_item name= "font_color_disabled" type= "Color" default= "Color( 0.9, 0.9, 0.9, 0.2 )" >
2020-01-27 09:15:37 +08:00
Text [Color] used when the [Button] is disabled.
2017-09-13 04:42:36 +08:00
</theme_item>
2019-07-09 15:13:00 +08:00
<theme_item name= "font_color_hover" type= "Color" default= "Color( 0.94, 0.94, 0.94, 1 )" >
2020-01-27 09:15:37 +08:00
Text [Color] used when the [Button] is being hovered.
2017-09-13 04:42:36 +08:00
</theme_item>
2019-06-29 18:38:01 +08:00
<theme_item name= "font_color_pressed" type= "Color" default= "Color( 1, 1, 1, 1 )" >
2020-01-27 09:15:37 +08:00
Text [Color] used when the [Button] is being pressed.
2017-09-13 04:42:36 +08:00
</theme_item>
<theme_item name= "hover" type= "StyleBox" >
2020-01-27 09:15:37 +08:00
[StyleBox] used when the [Button] is being hovered.
2017-09-13 04:42:36 +08:00
</theme_item>
2019-06-29 18:38:01 +08:00
<theme_item name= "hseparation" type= "int" default= "2" >
2020-01-27 09:15:37 +08:00
The horizontal space between [Button]'s icon and text.
2017-09-13 04:42:36 +08:00
</theme_item>
<theme_item name= "normal" type= "StyleBox" >
2020-01-27 09:15:37 +08:00
Default [StyleBox] for the [Button].
2017-09-13 04:42:36 +08:00
</theme_item>
<theme_item name= "pressed" type= "StyleBox" >
2020-01-27 09:15:37 +08:00
[StyleBox] used when the [Button] is being pressed.
2017-09-13 04:42:36 +08:00
</theme_item>
</theme_items>
</class>