class_buttonarray.rst 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. .. _class_ButtonArray:
  2. ButtonArray
  3. ===========
  4. **Inherits:** :ref:`Control<class_control>`
  5. **Category:** Core
  6. Array of Buttons.
  7. Member Functions
  8. ----------------
  9. +------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
  10. | void | :ref:`add_button<class_ButtonArray_add_button>` **(** :ref:`String<class_string>` text **)** |
  11. +------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
  12. | void | :ref:`add_icon_button<class_ButtonArray_add_icon_button>` **(** :ref:`Object<class_object>` icon, :ref:`String<class_string>` text="" **)** |
  13. +------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
  14. | void | :ref:`set_button_text<class_ButtonArray_set_button_text>` **(** :ref:`int<class_int>` button, :ref:`String<class_string>` text **)** |
  15. +------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
  16. | void | :ref:`set_button_icon<class_ButtonArray_set_button_icon>` **(** :ref:`int<class_int>` button, :ref:`Object<class_object>` icon **)** |
  17. +------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
  18. | :ref:`String<class_string>` | :ref:`get_button_text<class_ButtonArray_get_button_text>` **(** :ref:`int<class_int>` button **)** const |
  19. +------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
  20. | :ref:`Object<class_object>` | :ref:`get_button_icon<class_ButtonArray_get_button_icon>` **(** :ref:`int<class_int>` button **)** const |
  21. +------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
  22. | :ref:`int<class_int>` | :ref:`get_button_count<class_ButtonArray_get_button_count>` **(** **)** const |
  23. +------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
  24. | :ref:`int<class_int>` | :ref:`get_selected<class_ButtonArray_get_selected>` **(** **)** const |
  25. +------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
  26. | :ref:`int<class_int>` | :ref:`get_hovered<class_ButtonArray_get_hovered>` **(** **)** const |
  27. +------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
  28. | void | :ref:`set_selected<class_ButtonArray_set_selected>` **(** :ref:`int<class_int>` button **)** |
  29. +------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
  30. | void | :ref:`erase_button<class_ButtonArray_erase_button>` **(** :ref:`int<class_int>` button **)** |
  31. +------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
  32. | void | :ref:`clear<class_ButtonArray_clear>` **(** **)** |
  33. +------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
  34. Signals
  35. -------
  36. - **button_selected** **(** :ref:`int<class_int>` button **)**
  37. Numeric Constants
  38. -----------------
  39. - **ALIGN_BEGIN** = **0** --- Align buttons at the begining.
  40. - **ALIGN_CENTER** = **1** --- Align buttons in the middle.
  41. - **ALIGN_END** = **2** --- Align buttons at the end.
  42. - **ALIGN_FILL** = **3** --- Spread the buttons, but keep them small.
  43. - **ALIGN_EXPAND_FILL** = **4** --- Spread the buttons, but expand them.
  44. Description
  45. -----------
  46. 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 joypad based interfaces and option menus.
  47. Member Function Description
  48. ---------------------------
  49. .. _class_ButtonArray_add_button:
  50. - void **add_button** **(** :ref:`String<class_string>` text **)**
  51. Add a new button.
  52. .. _class_ButtonArray_add_icon_button:
  53. - void **add_icon_button** **(** :ref:`Object<class_object>` icon, :ref:`String<class_string>` text="" **)**
  54. .. _class_ButtonArray_set_button_text:
  55. - void **set_button_text** **(** :ref:`int<class_int>` button, :ref:`String<class_string>` text **)**
  56. .. _class_ButtonArray_set_button_icon:
  57. - void **set_button_icon** **(** :ref:`int<class_int>` button, :ref:`Object<class_object>` icon **)**
  58. Set the icon of an existing button.
  59. .. _class_ButtonArray_get_button_text:
  60. - :ref:`String<class_string>` **get_button_text** **(** :ref:`int<class_int>` button **)** const
  61. Return the text of an existing button.
  62. .. _class_ButtonArray_get_button_icon:
  63. - :ref:`Object<class_object>` **get_button_icon** **(** :ref:`int<class_int>` button **)** const
  64. Return the icon of an existing button.
  65. .. _class_ButtonArray_get_button_count:
  66. - :ref:`int<class_int>` **get_button_count** **(** **)** const
  67. Return the amount of buttons in the array.
  68. .. _class_ButtonArray_get_selected:
  69. - :ref:`int<class_int>` **get_selected** **(** **)** const
  70. Return the currently selected button in the array.
  71. .. _class_ButtonArray_get_hovered:
  72. - :ref:`int<class_int>` **get_hovered** **(** **)** const
  73. Return the currently hovered button in the array.
  74. .. _class_ButtonArray_set_selected:
  75. - void **set_selected** **(** :ref:`int<class_int>` button **)**
  76. Sekect a button in the array.
  77. .. _class_ButtonArray_erase_button:
  78. - void **erase_button** **(** :ref:`int<class_int>` button **)**
  79. Remove a button in the array, by index.
  80. .. _class_ButtonArray_clear:
  81. - void **clear** **(** **)**
  82. Clear the button array.