class_buttonarray.rst 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the doc/base/classes.xml source instead.
  3. .. _class_ButtonArray:
  4. ButtonArray
  5. ===========
  6. **Inherits:** :ref:`Control<class_control>` **<** :ref:`CanvasItem<class_canvasitem>` **<** :ref:`Node<class_node>` **<** :ref:`Object<class_object>`
  7. **Inherited By:** :ref:`HButtonArray<class_hbuttonarray>`, :ref:`VButtonArray<class_vbuttonarray>`
  8. **Category:** Core
  9. Brief Description
  10. -----------------
  11. Array of Buttons.
  12. Member Functions
  13. ----------------
  14. +------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
  15. | void | :ref:`add_button<class_ButtonArray_add_button>` **(** :ref:`String<class_string>` text **)** |
  16. +------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
  17. | void | :ref:`add_icon_button<class_ButtonArray_add_icon_button>` **(** :ref:`Object<class_object>` icon, :ref:`String<class_string>` text="" **)** |
  18. +------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
  19. | void | :ref:`set_button_text<class_ButtonArray_set_button_text>` **(** :ref:`int<class_int>` button, :ref:`String<class_string>` text **)** |
  20. +------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
  21. | void | :ref:`set_button_icon<class_ButtonArray_set_button_icon>` **(** :ref:`int<class_int>` button, :ref:`Object<class_object>` icon **)** |
  22. +------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
  23. | :ref:`String<class_string>` | :ref:`get_button_text<class_ButtonArray_get_button_text>` **(** :ref:`int<class_int>` button **)** const |
  24. +------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
  25. | :ref:`Object<class_object>` | :ref:`get_button_icon<class_ButtonArray_get_button_icon>` **(** :ref:`int<class_int>` button **)** const |
  26. +------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
  27. | :ref:`int<class_int>` | :ref:`get_button_count<class_ButtonArray_get_button_count>` **(** **)** const |
  28. +------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
  29. | :ref:`int<class_int>` | :ref:`get_selected<class_ButtonArray_get_selected>` **(** **)** const |
  30. +------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
  31. | :ref:`int<class_int>` | :ref:`get_hovered<class_ButtonArray_get_hovered>` **(** **)** const |
  32. +------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
  33. | void | :ref:`set_selected<class_ButtonArray_set_selected>` **(** :ref:`int<class_int>` button **)** |
  34. +------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
  35. | void | :ref:`erase_button<class_ButtonArray_erase_button>` **(** :ref:`int<class_int>` button **)** |
  36. +------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
  37. | void | :ref:`clear<class_ButtonArray_clear>` **(** **)** |
  38. +------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
  39. Signals
  40. -------
  41. - **button_selected** **(** :ref:`int<class_int>` button **)**
  42. Numeric Constants
  43. -----------------
  44. - **ALIGN_BEGIN** = **0** --- Align buttons at the beginning.
  45. - **ALIGN_CENTER** = **1** --- Align buttons in the middle.
  46. - **ALIGN_END** = **2** --- Align buttons at the end.
  47. - **ALIGN_FILL** = **3** --- Spread the buttons, but keep them small.
  48. - **ALIGN_EXPAND_FILL** = **4** --- Spread the buttons, but expand them.
  49. Description
  50. -----------
  51. Array of Buttons. A Button array is useful to have an array of buttons laid out vertically or horizontally. Only one can be selected. This is useful for joy pad based interfaces and option menus.
  52. Member Function Description
  53. ---------------------------
  54. .. _class_ButtonArray_add_button:
  55. - void **add_button** **(** :ref:`String<class_string>` text **)**
  56. Add a new button.
  57. .. _class_ButtonArray_add_icon_button:
  58. - void **add_icon_button** **(** :ref:`Object<class_object>` icon, :ref:`String<class_string>` text="" **)**
  59. .. _class_ButtonArray_set_button_text:
  60. - void **set_button_text** **(** :ref:`int<class_int>` button, :ref:`String<class_string>` text **)**
  61. .. _class_ButtonArray_set_button_icon:
  62. - void **set_button_icon** **(** :ref:`int<class_int>` button, :ref:`Object<class_object>` icon **)**
  63. Set the icon of an existing button.
  64. .. _class_ButtonArray_get_button_text:
  65. - :ref:`String<class_string>` **get_button_text** **(** :ref:`int<class_int>` button **)** const
  66. Return the text of an existing button.
  67. .. _class_ButtonArray_get_button_icon:
  68. - :ref:`Object<class_object>` **get_button_icon** **(** :ref:`int<class_int>` button **)** const
  69. Return the icon of an existing button.
  70. .. _class_ButtonArray_get_button_count:
  71. - :ref:`int<class_int>` **get_button_count** **(** **)** const
  72. Return the amount of buttons in the array.
  73. .. _class_ButtonArray_get_selected:
  74. - :ref:`int<class_int>` **get_selected** **(** **)** const
  75. Return the currently selected button in the array.
  76. .. _class_ButtonArray_get_hovered:
  77. - :ref:`int<class_int>` **get_hovered** **(** **)** const
  78. Return the currently hovered button in the array.
  79. .. _class_ButtonArray_set_selected:
  80. - void **set_selected** **(** :ref:`int<class_int>` button **)**
  81. Select a button in the array.
  82. .. _class_ButtonArray_erase_button:
  83. - void **erase_button** **(** :ref:`int<class_int>` button **)**
  84. Remove a button in the array, by index.
  85. .. _class_ButtonArray_clear:
  86. - void **clear** **(** **)**
  87. Clear the button array.