:github_url: hide # RevisedButton **Inherits:** [BaseButton](https://docs.godotengine.org/en/stable/classes/class_basebutton.html) **Inherited By:** [ExpandableButton](./ExpandableButton.md) [Button](https://docs.godotengine.org/en/stable/classes/class_button.html) wich uses [RichTextLable](https://docs.godotengine.org/en/stable/classes/class_richtextlable.html) to show text. ## Description **RevisedButton** is more complex themed button than [Button](https://docs.godotengine.org/en/stable/classes/class_button.html). It can contain text and an icon, and it will display them according to the current [Theme](https://docs.godotengine.org/en/stable/classes/class_theme.html). **Example of creating a **RevisedButton** and assigning an action when pressed by code:** .. tabs:: .. code-tab:: gdscript func _ready() -> void: var button = RevisedButton.new() button.text = "[i]Click[/i] [b][color=LightGreen]me[/color][/b]" button.pressed.connect(self._revised_button_pressed) add_child(button) button.size = Vector2(125,45) func _revised_button_pressed(): print_rich("[color=Violet]Hello world![/color]") .. code-tab:: csharp public override void _Ready() { var button = new RevisedButton(); button.Text = "[i]Click[/i] [b][color=LightGreen]me[/color][/b]"; button.Size.X = 125; button.Size.Y = 45; button.Pressed += RevisedButtonPressed; AddChild(button); } private void RevisedButtonPressed() { GD.Print("Hello world!"); } See also [BaseButton](https://docs.godotengine.org/en/stable/classes/class_basebutton.html) which contains common properties and methods associated with this node. **Note:** Buttons do not interpret touch input and therefore don't support multitouch, since mouse emulation can only press one button at a given time. Use [TouchScreenButton](https://docs.godotengine.org/en/stable/classes/class_touchscreenbutton.html) for buttons that trigger gameplay movement or actions. ## Properties | | | | |-------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------|------------| | [ALIGNMENT_ORDER](./RevisedButton.md#enum_ALIGNMENT_ORDER) | [alignment_order](#property_alignment_order) | ``0`` | | [float](https://docs.godotengine.org/en/stable/classes/class_float.html) | [auto_scrolling_speed](#property_auto_scrolling_speed) | ``20.0`` | | [AutowrapMode](https://docs.godotengine.org/en/stable/classes/class_textserver.html#enum_TextServer_AutowrapMode) | [autowrap_mode](#property_autowrap_mode) | ``3`` | | [bool](https://docs.godotengine.org/en/stable/classes/class_bool.html) | [expand_icon](#property_expand_icon) | ``false`` | | [bool](https://docs.godotengine.org/en/stable/classes/class_bool.html) | [flat](#property_flat) | ``false`` | | [HorizontalAlignment](https://docs.godotengine.org/en/stable/classes/class_@globalscope.html#enum_@GlobalScope_HorizontalAlignment) | [horizontal_text_alignment](#property_horizontal_text_alignment) | ``1`` | | [Texture2D](https://docs.godotengine.org/en/stable/classes/class_texture2d.html) | [icon](#property_icon) | | | [HorizontalAlignment](https://docs.godotengine.org/en/stable/classes/class_@globalscope.html#enum_@GlobalScope_HorizontalAlignment) | [icon_alignment](#property_icon_alignment) | ``1`` | | [bool](https://docs.godotengine.org/en/stable/classes/class_bool.html) | [is_text_off](#property_is_text_off) | ``false`` | | [String](https://docs.godotengine.org/en/stable/classes/class_string.html) | [text](#property_text) | ``"Text"`` | | [VerticalAlignment](https://docs.godotengine.org/en/stable/classes/class_@globalscope.html#enum_@GlobalScope_VerticalAlignment) | [vertical_icon_alignment](#property_vertical_icon_alignment) | ``0`` | | [VerticalAlignment](https://docs.godotengine.org/en/stable/classes/class_@globalscope.html#enum_@GlobalScope_VerticalAlignment) | [vertical_text_alignment](#property_vertical_text_alignment) | ``0`` | --- ## Enumerations #### enum **ALIGNMENT_ORDER**: ##### [ALIGNMENT_ORDER](./RevisedButton.md#enum_ALIGNMENT_ORDER) **ALIGNMENT_ORDER_VERTICAL_FIRST** = ``1`` There is currently no description for this enum. Please help us by [contributing one ](https://docs.godotengine.org/en/stable/contributing/documentation/updating_the_class_reference.html)! ##### [ALIGNMENT_ORDER](./RevisedButton.md#enum_ALIGNMENT_ORDER) **ALIGNMENT_ORDER_HORIZONTAL_FIRST** = ``0`` There is currently no description for this enum. Please help us by [contributing one ](https://docs.godotengine.org/en/stable/contributing/documentation/updating_the_class_reference.html)! --- ## Property Descriptions #### [ALIGNMENT_ORDER](./RevisedButton.md#enum_ALIGNMENT_ORDER) **alignment_order** = ``0`` - *void* **set_alignment_order**( value\: [ALIGNMENT_ORDER](./RevisedButton.md#enum_ALIGNMENT_ORDER) ) - [ALIGNMENT_ORDER](./RevisedButton.md#enum_ALIGNMENT_ORDER) **get_alignment_order**( ) Defines which alignment is more important. See [ALIGNMENT_ORDER](./RevisedButton.md#enum_ALIGNMENT_ORDER) for more details. **Note:** Will be expanded in future versions. #### [float](https://docs.godotengine.org/en/stable/classes/class_float.html) **auto_scrolling_speed** = ``20.0`` - *void* **set_adaptable_speed**( value\: [float](https://docs.godotengine.org/en/stable/classes/class_float.html) ) - [float](https://docs.godotengine.org/en/stable/classes/class_float.html) **get_adaptable_speed**( ) Defines speed of text auto scrolling. See [AutoScroll](./AutoScroll.md) for more details. #### [AutowrapMode](https://docs.godotengine.org/en/stable/classes/class_textserver.html#enum_TextServer_AutowrapMode) **autowrap_mode** = ``3`` - *void* **set_text_autowrap**( value\: [AutowrapMode](https://docs.godotengine.org/en/stable/classes/class_textserver.html#enum_TextServer_AutowrapMode) ) - [AutowrapMode](https://docs.godotengine.org/en/stable/classes/class_textserver.html#enum_TextServer_AutowrapMode) **get_text_autowrap**( ) If set to something other than [TextServer.AUTOWRAP_OFF](https://docs.godotengine.org/en/stable/classes/class_textserver.html#class_textserver_constant_AUTOWRAP_OFF),wich should always be true, the text gets wrapped inside the node's bounding rectangle. #### [bool](https://docs.godotengine.org/en/stable/classes/class_bool.html) **expand_icon** = ``false`` - *void* **set_expand_icon**( value\: [bool](https://docs.godotengine.org/en/stable/classes/class_bool.html) ) - [bool](https://docs.godotengine.org/en/stable/classes/class_bool.html) **is_expand_icon**( ) When enabled, the button's icon will expand/shrink to fit the button's size while keeping its aspect. #### [bool](https://docs.godotengine.org/en/stable/classes/class_bool.html) **flat** = ``false`` - *void* **set_flat**( value\: [bool](https://docs.godotengine.org/en/stable/classes/class_bool.html) ) - [bool](https://docs.godotengine.org/en/stable/classes/class_bool.html) **is_flat**( ) Flat buttons don't display decoration. #### [HorizontalAlignment](https://docs.godotengine.org/en/stable/classes/class_@globalscope.html#enum_@GlobalScope_HorizontalAlignment) **horizontal_text_alignment** = ``1`` - *void* **set_text_alignment**( value\: [HorizontalAlignment](https://docs.godotengine.org/en/stable/classes/class_@globalscope.html#enum_@GlobalScope_HorizontalAlignment) ) - [HorizontalAlignment](https://docs.godotengine.org/en/stable/classes/class_@globalscope.html#enum_@GlobalScope_HorizontalAlignment) **get_text_alignment**( ) Text alignment policy for the button's text, use one of the [HorizontalAlignment](https://docs.godotengine.org/en/stable/classes/class_@globalscope.html#enum_@GlobalScope_HorizontalAlignment) constants. #### [Texture2D](https://docs.godotengine.org/en/stable/classes/class_texture2d.html) **icon** - *void* **set_button_icon**( value\: [Texture2D](https://docs.godotengine.org/en/stable/classes/class_texture2d.html) ) - [Texture2D](https://docs.godotengine.org/en/stable/classes/class_texture2d.html) **get_button_icon**( ) Button's icon, if text is present the icon will be placed before the text unless its horizontal alignment is set to [@GlobalScope.HORIZONTAL_ALIGNMENT_RIGHT](./@globalscope.md#constant_HORIZONTAL_ALIGNMENT_RIGHT). #### [HorizontalAlignment](https://docs.godotengine.org/en/stable/classes/class_@globalscope.html#enum_@GlobalScope_HorizontalAlignment) **icon_alignment** = ``1`` - *void* **set_icon_alignment**( value\: [HorizontalAlignment](https://docs.godotengine.org/en/stable/classes/class_@globalscope.html#enum_@GlobalScope_HorizontalAlignment) ) - [HorizontalAlignment](https://docs.godotengine.org/en/stable/classes/class_@globalscope.html#enum_@GlobalScope_HorizontalAlignment) **get_icon_alignment**( ) Specifies if the icon should be aligned horizontally to the left, right, or center of a button. Uses the same [HorizontalAlignment](https://docs.godotengine.org/en/stable/classes/class_@globalscope.html#enum_@GlobalScope_HorizontalAlignment) constants as the text alignment. #### [bool](https://docs.godotengine.org/en/stable/classes/class_bool.html) **is_text_off** = ``false`` - *void* **set_text_off**( value\: [bool](https://docs.godotengine.org/en/stable/classes/class_bool.html) ) - [bool](https://docs.godotengine.org/en/stable/classes/class_bool.html) **is_text_off**( ) When enabled, the text will be hidden. #### [String](https://docs.godotengine.org/en/stable/classes/class_string.html) **text** = ``"Text"`` - *void* **set_text**( value\: [String](https://docs.godotengine.org/en/stable/classes/class_string.html) ) - [String](https://docs.godotengine.org/en/stable/classes/class_string.html) **get_text**( ) The button's text that will be displayed inside the button's area. #### [VerticalAlignment](https://docs.godotengine.org/en/stable/classes/class_@globalscope.html#enum_@GlobalScope_VerticalAlignment) **vertical_icon_alignment** = ``0`` - *void* **set_vertical_icon_alignment**( value\: [VerticalAlignment](https://docs.godotengine.org/en/stable/classes/class_@globalscope.html#enum_@GlobalScope_VerticalAlignment) ) - [VerticalAlignment](https://docs.godotengine.org/en/stable/classes/class_@globalscope.html#enum_@GlobalScope_VerticalAlignment) **get_vertical_icon_alignment**( ) Specifies if the icon should be aligned vertically to the top, bottom, or center of a button. Uses the same [VerticalAlignment](https://docs.godotengine.org/en/stable/classes/class_@globalscope.html#enum_@GlobalScope_VerticalAlignment) constants as the text alignment. #### [VerticalAlignment](https://docs.godotengine.org/en/stable/classes/class_@globalscope.html#enum_@GlobalScope_VerticalAlignment) **vertical_text_alignment** = ``0`` - *void* **set_v_text_alignment**( value\: [VerticalAlignment](https://docs.godotengine.org/en/stable/classes/class_@globalscope.html#enum_@GlobalScope_VerticalAlignment) ) - [VerticalAlignment](https://docs.godotengine.org/en/stable/classes/class_@globalscope.html#enum_@GlobalScope_VerticalAlignment) **get_v_text_alignment**( ) Text alignment policy for the button's text, use one of the [VerticalAlignment](https://docs.godotengine.org/en/stable/classes/class_@globalscope.html#enum_@GlobalScope_VerticalAlignment) constants.