diff options
Diffstat (limited to 'doc/classes/Button.xml')
-rw-r--r-- | doc/classes/Button.xml | 102 |
1 files changed, 39 insertions, 63 deletions
diff --git a/doc/classes/Button.xml b/doc/classes/Button.xml index dfbd6c0680..1cd9ca0afb 100644 --- a/doc/classes/Button.xml +++ b/doc/classes/Button.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="Button" inherits="BaseButton" version="4.0"> +<class name="Button" inherits="BaseButton" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> Standard themed Button. </brief_description> @@ -40,32 +40,9 @@ <link title="2D Dodge The Creeps Demo">https://godotengine.org/asset-library/asset/515</link> <link title="OS Test Demo">https://godotengine.org/asset-library/asset/677</link> </tutorials> - <methods> - <method name="clear_opentype_features"> - <return type="void" /> - <description> - Removes all OpenType features. - </description> - </method> - <method name="get_opentype_feature" qualifiers="const"> - <return type="int" /> - <argument index="0" name="tag" type="String" /> - <description> - Returns OpenType feature [code]tag[/code]. - </description> - </method> - <method name="set_opentype_feature"> - <return type="void" /> - <argument index="0" name="tag" type="String" /> - <argument index="1" name="value" type="int" /> - <description> - Sets OpenType feature [code]tag[/code]. More info: [url=https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags]OpenType feature tags[/url]. - </description> - </method> - </methods> <members> - <member name="align" type="int" setter="set_text_align" getter="get_text_align" enum="Button.TextAlign" default="1"> - Text alignment policy for the button's text, use one of the [enum TextAlign] constants. + <member name="alignment" type="int" setter="set_text_alignment" getter="get_text_alignment" enum="HorizontalAlignment" default="1"> + Text alignment policy for the button's text, use one of the [enum @GlobalScope.HorizontalAlignment] constants. </member> <member name="clip_text" type="bool" setter="set_clip_text" getter="get_clip_text" default="false"> 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. @@ -78,9 +55,10 @@ </member> <member name="icon" type="Texture2D" setter="set_button_icon" getter="get_button_icon"> Button's icon, if text is present the icon will be placed before the text. + To edit margin and spacing of the icon, use [theme_item h_separation] theme property and [code]content_margin_*[/code] properties of the used [StyleBox]es. </member> - <member name="icon_align" type="int" setter="set_icon_align" getter="get_icon_align" enum="Button.TextAlign" default="0"> - Specifies if the icon should be aligned to the left, right, or center of a button. Uses the same [enum TextAlign] constants as the text alignment. If centered, text will draw on top of the icon. + <member name="icon_alignment" type="int" setter="set_icon_alignment" getter="get_icon_alignment" enum="HorizontalAlignment" default="0"> + Specifies if the icon should be aligned to the left, right, or center of a button. Uses the same [enum @GlobalScope.HorizontalAlignment] constants as the text alignment. If centered, text will draw on top of the icon. </member> <member name="language" type="String" setter="set_language" getter="get_language" default=""""> Language code used for line-breaking and text shaping algorithms, if left empty current locale is used instead. @@ -91,35 +69,21 @@ <member name="text_direction" type="int" setter="set_text_direction" getter="get_text_direction" enum="Control.TextDirection" default="0"> Base text writing direction. </member> + <member name="text_overrun_behavior" type="int" setter="set_text_overrun_behavior" getter="get_text_overrun_behavior" enum="TextServer.OverrunBehavior" default="0"> + Sets the clipping behavior when the text exceeds the node's bounding rectangle. See [enum TextServer.OverrunBehavior] for a description of all modes. + </member> </members> - <constants> - <constant name="ALIGN_LEFT" value="0" enum="TextAlign"> - Align the text to the left. - </constant> - <constant name="ALIGN_CENTER" value="1" enum="TextAlign"> - Align the text to the center. - </constant> - <constant name="ALIGN_RIGHT" value="2" enum="TextAlign"> - Align the text to the right. - </constant> - </constants> <theme_items> - <theme_item name="disabled" data_type="style" type="StyleBox"> - [StyleBox] used when the [Button] is disabled. - </theme_item> - <theme_item name="focus" data_type="style" type="StyleBox"> - [StyleBox] used when the [Button] is focused. It is displayed over the current [StyleBox], so using [StyleBoxEmpty] will just disable the focus visual effect. - </theme_item> - <theme_item name="font" data_type="font" type="Font"> - [Font] of the [Button]'s text. - </theme_item> - <theme_item name="font_color" data_type="color" type="Color" default="Color(0.88, 0.88, 0.88, 1)"> + <theme_item name="font_color" data_type="color" type="Color" default="Color(0.875, 0.875, 0.875, 1)"> Default text [Color] of the [Button]. </theme_item> - <theme_item name="font_disabled_color" data_type="color" type="Color" default="Color(0.9, 0.9, 0.9, 0.2)"> + <theme_item name="font_disabled_color" data_type="color" type="Color" default="Color(0.875, 0.875, 0.875, 0.5)"> Text [Color] used when the [Button] is disabled. </theme_item> - <theme_item name="font_hover_color" data_type="color" type="Color" default="Color(0.94, 0.94, 0.94, 1)"> + <theme_item name="font_focus_color" data_type="color" type="Color" default="Color(0.95, 0.95, 0.95, 1)"> + Text [Color] used when the [Button] is focused. Only replaces the normal text color of the button. Disabled, hovered, and pressed states take precedence over this color. + </theme_item> + <theme_item name="font_hover_color" data_type="color" type="Color" default="Color(0.95, 0.95, 0.95, 1)"> Text [Color] used when the [Button] is being hovered. </theme_item> <theme_item name="font_hover_pressed_color" data_type="color" type="Color" default="Color(1, 1, 1, 1)"> @@ -131,18 +95,12 @@ <theme_item name="font_pressed_color" data_type="color" type="Color" default="Color(1, 1, 1, 1)"> Text [Color] used when the [Button] is being pressed. </theme_item> - <theme_item name="font_size" data_type="font_size" type="int"> - Font size of the [Button]'s text. - </theme_item> - <theme_item name="hover" data_type="style" type="StyleBox"> - [StyleBox] used when the [Button] is being hovered. - </theme_item> - <theme_item name="hseparation" data_type="constant" type="int" default="2"> - The horizontal space between [Button]'s icon and text. - </theme_item> - <theme_item name="icon_disabled_color" data_type="color" type="Color" default="Color(1, 1, 1, 1)"> + <theme_item name="icon_disabled_color" data_type="color" type="Color" default="Color(1, 1, 1, 0.4)"> Icon modulate [Color] used when the [Button] is disabled. </theme_item> + <theme_item name="icon_focus_color" data_type="color" type="Color" default="Color(1, 1, 1, 1)"> + Icon modulate [Color] used when the [Button] is focused. Only replaces the normal modulate color of the button. Disabled, hovered, and pressed states take precedence over this color. + </theme_item> <theme_item name="icon_hover_color" data_type="color" type="Color" default="Color(1, 1, 1, 1)"> Icon modulate [Color] used when the [Button] is being hovered. </theme_item> @@ -155,12 +113,30 @@ <theme_item name="icon_pressed_color" data_type="color" type="Color" default="Color(1, 1, 1, 1)"> Icon modulate [Color] used when the [Button] is being pressed. </theme_item> - <theme_item name="normal" data_type="style" type="StyleBox"> - Default [StyleBox] for the [Button]. + <theme_item name="h_separation" data_type="constant" type="int" default="2"> + The horizontal space between [Button]'s icon and text. </theme_item> <theme_item name="outline_size" data_type="constant" type="int" default="0"> The size of the text outline. </theme_item> + <theme_item name="font" data_type="font" type="Font"> + [Font] of the [Button]'s text. + </theme_item> + <theme_item name="font_size" data_type="font_size" type="int"> + Font size of the [Button]'s text. + </theme_item> + <theme_item name="disabled" data_type="style" type="StyleBox"> + [StyleBox] used when the [Button] is disabled. + </theme_item> + <theme_item name="focus" data_type="style" type="StyleBox"> + [StyleBox] used when the [Button] is focused. The [code]focus[/code] [StyleBox] is displayed [i]over[/i] the base [StyleBox], so a partially transparent [StyleBox] should be used to ensure the base [StyleBox] remains visible. A [StyleBox] that represents an outline or an underline works well for this purpose. To disable the focus visual effect, assign a [StyleBoxEmpty] resource. Note that disabling the focus visual effect will harm keyboard/controller navigation usability, so this is not recommended for accessibility reasons. + </theme_item> + <theme_item name="hover" data_type="style" type="StyleBox"> + [StyleBox] used when the [Button] is being hovered. + </theme_item> + <theme_item name="normal" data_type="style" type="StyleBox"> + Default [StyleBox] for the [Button]. + </theme_item> <theme_item name="pressed" data_type="style" type="StyleBox"> [StyleBox] used when the [Button] is being pressed. </theme_item> |