mirror of
https://github.com/godotengine/godot-docs.git
synced 2026-01-04 14:11:02 +03:00
classref: Add property overview and setter/getter like in editor docs
Output from godotengine/godot#22013. Fixes #1729.
This commit is contained in:
@@ -8,7 +8,9 @@ Button
|
||||
======
|
||||
|
||||
**Inherits:** :ref:`BaseButton<class_BaseButton>` **<** :ref:`Control<class_Control>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
|
||||
|
||||
**Inherited By:** :ref:`OptionButton<class_OptionButton>`, :ref:`ColorPickerButton<class_ColorPickerButton>`, :ref:`CheckButton<class_CheckButton>`, :ref:`MenuButton<class_MenuButton>`, :ref:`ToolButton<class_ToolButton>`, :ref:`CheckBox<class_CheckBox>`
|
||||
|
||||
**Category:** Core
|
||||
|
||||
Brief Description
|
||||
@@ -16,18 +18,59 @@ Brief Description
|
||||
|
||||
Standard themed Button.
|
||||
|
||||
Properties
|
||||
----------
|
||||
|
||||
+-----------------------------------------+------------------------------------------+
|
||||
| :ref:`TextAlign<enum_Button_TextAlign>` | :ref:`align<class_Button_align>` |
|
||||
+-----------------------------------------+------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`clip_text<class_Button_clip_text>` |
|
||||
+-----------------------------------------+------------------------------------------+
|
||||
| :ref:`bool<class_bool>` | :ref:`flat<class_Button_flat>` |
|
||||
+-----------------------------------------+------------------------------------------+
|
||||
| :ref:`Texture<class_Texture>` | :ref:`icon<class_Button_icon>` |
|
||||
+-----------------------------------------+------------------------------------------+
|
||||
| :ref:`String<class_String>` | :ref:`text<class_Button_text>` |
|
||||
+-----------------------------------------+------------------------------------------+
|
||||
|
||||
Theme Properties
|
||||
----------------
|
||||
|
||||
+---------------------------------+--------------------------------------------------------------+
|
||||
| :ref:`StyleBox<class_StyleBox>` | :ref:`disabled<class_Button_disabled>` |
|
||||
+---------------------------------+--------------------------------------------------------------+
|
||||
| :ref:`StyleBox<class_StyleBox>` | :ref:`focus<class_Button_focus>` |
|
||||
+---------------------------------+--------------------------------------------------------------+
|
||||
| :ref:`Font<class_Font>` | :ref:`font<class_Button_font>` |
|
||||
+---------------------------------+--------------------------------------------------------------+
|
||||
| :ref:`Color<class_Color>` | :ref:`font_color<class_Button_font_color>` |
|
||||
+---------------------------------+--------------------------------------------------------------+
|
||||
| :ref:`Color<class_Color>` | :ref:`font_color_disabled<class_Button_font_color_disabled>` |
|
||||
+---------------------------------+--------------------------------------------------------------+
|
||||
| :ref:`Color<class_Color>` | :ref:`font_color_hover<class_Button_font_color_hover>` |
|
||||
+---------------------------------+--------------------------------------------------------------+
|
||||
| :ref:`Color<class_Color>` | :ref:`font_color_pressed<class_Button_font_color_pressed>` |
|
||||
+---------------------------------+--------------------------------------------------------------+
|
||||
| :ref:`StyleBox<class_StyleBox>` | :ref:`hover<class_Button_hover>` |
|
||||
+---------------------------------+--------------------------------------------------------------+
|
||||
| :ref:`int<class_int>` | :ref:`hseparation<class_Button_hseparation>` |
|
||||
+---------------------------------+--------------------------------------------------------------+
|
||||
| :ref:`StyleBox<class_StyleBox>` | :ref:`normal<class_Button_normal>` |
|
||||
+---------------------------------+--------------------------------------------------------------+
|
||||
| :ref:`StyleBox<class_StyleBox>` | :ref:`pressed<class_Button_pressed>` |
|
||||
+---------------------------------+--------------------------------------------------------------+
|
||||
|
||||
Enumerations
|
||||
------------
|
||||
|
||||
.. _enum_Button_TextAlign:
|
||||
|
||||
enum **TextAlign**
|
||||
enum **TextAlign**:
|
||||
|
||||
- **ALIGN_LEFT** = **0** --- Align the text to the left.
|
||||
- **ALIGN_CENTER** = **1** --- Align the text to the center.
|
||||
- **ALIGN_RIGHT** = **2** --- Align the text to the right.
|
||||
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
||||
@@ -38,22 +81,61 @@ Property Descriptions
|
||||
|
||||
.. _class_Button_align:
|
||||
|
||||
- :ref:`TextAlign<enum_Button_TextAlign>` **align** - Text alignment policy for the button's text, use one of the ALIGN\_\* constants.
|
||||
- :ref:`TextAlign<enum_Button_TextAlign>` **align**
|
||||
|
||||
+----------+-----------------------+
|
||||
| *Setter* | set_text_align(value) |
|
||||
+----------+-----------------------+
|
||||
| *Getter* | get_text_align() |
|
||||
+----------+-----------------------+
|
||||
|
||||
Text alignment policy for the button's text, use one of the ALIGN\_\* constants.
|
||||
|
||||
.. _class_Button_clip_text:
|
||||
|
||||
- :ref:`bool<class_bool>` **clip_text** - 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. This property is disabled by default.
|
||||
- :ref:`bool<class_bool>` **clip_text**
|
||||
|
||||
+----------+----------------------+
|
||||
| *Setter* | set_clip_text(value) |
|
||||
+----------+----------------------+
|
||||
| *Getter* | get_clip_text() |
|
||||
+----------+----------------------+
|
||||
|
||||
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. This property is disabled by default.
|
||||
|
||||
.. _class_Button_flat:
|
||||
|
||||
- :ref:`bool<class_bool>` **flat** - Flat buttons don't display decoration.
|
||||
- :ref:`bool<class_bool>` **flat**
|
||||
|
||||
+----------+-----------------+
|
||||
| *Setter* | set_flat(value) |
|
||||
+----------+-----------------+
|
||||
| *Getter* | is_flat() |
|
||||
+----------+-----------------+
|
||||
|
||||
Flat buttons don't display decoration.
|
||||
|
||||
.. _class_Button_icon:
|
||||
|
||||
- :ref:`Texture<class_Texture>` **icon** - Button's icon, if text is present the icon will be placed before the text.
|
||||
- :ref:`Texture<class_Texture>` **icon**
|
||||
|
||||
+----------+------------------------+
|
||||
| *Setter* | set_button_icon(value) |
|
||||
+----------+------------------------+
|
||||
| *Getter* | get_button_icon() |
|
||||
+----------+------------------------+
|
||||
|
||||
Button's icon, if text is present the icon will be placed before the text.
|
||||
|
||||
.. _class_Button_text:
|
||||
|
||||
- :ref:`String<class_String>` **text** - The button's text that will be displayed inside the button's area.
|
||||
- :ref:`String<class_String>` **text**
|
||||
|
||||
+----------+-----------------+
|
||||
| *Setter* | set_text(value) |
|
||||
+----------+-----------------+
|
||||
| *Getter* | get_text() |
|
||||
+----------+-----------------+
|
||||
|
||||
The button's text that will be displayed inside the button's area.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user