class_touchscreenbutton.rst 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the TouchScreenButton.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_TouchScreenButton:
  6. TouchScreenButton
  7. =================
  8. **Inherits:** :ref:`Node2D<class_Node2D>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  9. **Category:** Core
  10. Brief Description
  11. -----------------
  12. Button for touch screen devices.
  13. Properties
  14. ----------
  15. +--------------------------------------------------------------+--------------------------------------------------------------------------+
  16. | :ref:`String<class_String>` | :ref:`action<class_TouchScreenButton_property_action>` |
  17. +--------------------------------------------------------------+--------------------------------------------------------------------------+
  18. | :ref:`BitMap<class_BitMap>` | :ref:`bitmask<class_TouchScreenButton_property_bitmask>` |
  19. +--------------------------------------------------------------+--------------------------------------------------------------------------+
  20. | :ref:`Texture<class_Texture>` | :ref:`normal<class_TouchScreenButton_property_normal>` |
  21. +--------------------------------------------------------------+--------------------------------------------------------------------------+
  22. | :ref:`bool<class_bool>` | :ref:`passby_press<class_TouchScreenButton_property_passby_press>` |
  23. +--------------------------------------------------------------+--------------------------------------------------------------------------+
  24. | :ref:`Texture<class_Texture>` | :ref:`pressed<class_TouchScreenButton_property_pressed>` |
  25. +--------------------------------------------------------------+--------------------------------------------------------------------------+
  26. | :ref:`Shape2D<class_Shape2D>` | :ref:`shape<class_TouchScreenButton_property_shape>` |
  27. +--------------------------------------------------------------+--------------------------------------------------------------------------+
  28. | :ref:`bool<class_bool>` | :ref:`shape_centered<class_TouchScreenButton_property_shape_centered>` |
  29. +--------------------------------------------------------------+--------------------------------------------------------------------------+
  30. | :ref:`bool<class_bool>` | :ref:`shape_visible<class_TouchScreenButton_property_shape_visible>` |
  31. +--------------------------------------------------------------+--------------------------------------------------------------------------+
  32. | :ref:`VisibilityMode<enum_TouchScreenButton_VisibilityMode>` | :ref:`visibility_mode<class_TouchScreenButton_property_visibility_mode>` |
  33. +--------------------------------------------------------------+--------------------------------------------------------------------------+
  34. Methods
  35. -------
  36. +-------------------------+--------------------------------------------------------------------------------+
  37. | :ref:`bool<class_bool>` | :ref:`is_pressed<class_TouchScreenButton_method_is_pressed>` **(** **)** const |
  38. +-------------------------+--------------------------------------------------------------------------------+
  39. Signals
  40. -------
  41. .. _class_TouchScreenButton_signal_pressed:
  42. - **pressed** **(** **)**
  43. Emitted when the button is pressed (down).
  44. ----
  45. .. _class_TouchScreenButton_signal_released:
  46. - **released** **(** **)**
  47. Emitted when the button is released (up).
  48. Enumerations
  49. ------------
  50. .. _enum_TouchScreenButton_VisibilityMode:
  51. .. _class_TouchScreenButton_constant_VISIBILITY_ALWAYS:
  52. .. _class_TouchScreenButton_constant_VISIBILITY_TOUCHSCREEN_ONLY:
  53. enum **VisibilityMode**:
  54. - **VISIBILITY_ALWAYS** = **0** --- Always visible.
  55. - **VISIBILITY_TOUCHSCREEN_ONLY** = **1** --- Visible on touch screens only.
  56. Description
  57. -----------
  58. Button for touch screen devices. You can set it to be visible on all screens, or only on touch devices.
  59. Property Descriptions
  60. ---------------------
  61. .. _class_TouchScreenButton_property_action:
  62. - :ref:`String<class_String>` **action**
  63. +----------+-------------------+
  64. | *Setter* | set_action(value) |
  65. +----------+-------------------+
  66. | *Getter* | get_action() |
  67. +----------+-------------------+
  68. The button's action. Actions can be handled with :ref:`InputEventAction<class_InputEventAction>`.
  69. ----
  70. .. _class_TouchScreenButton_property_bitmask:
  71. - :ref:`BitMap<class_BitMap>` **bitmask**
  72. +----------+--------------------+
  73. | *Setter* | set_bitmask(value) |
  74. +----------+--------------------+
  75. | *Getter* | get_bitmask() |
  76. +----------+--------------------+
  77. The button's bitmask.
  78. ----
  79. .. _class_TouchScreenButton_property_normal:
  80. - :ref:`Texture<class_Texture>` **normal**
  81. +----------+--------------------+
  82. | *Setter* | set_texture(value) |
  83. +----------+--------------------+
  84. | *Getter* | get_texture() |
  85. +----------+--------------------+
  86. The button's texture for the normal state.
  87. ----
  88. .. _class_TouchScreenButton_property_passby_press:
  89. - :ref:`bool<class_bool>` **passby_press**
  90. +----------+---------------------------+
  91. | *Setter* | set_passby_press(value) |
  92. +----------+---------------------------+
  93. | *Getter* | is_passby_press_enabled() |
  94. +----------+---------------------------+
  95. If ``true``, passby presses are enabled.
  96. ----
  97. .. _class_TouchScreenButton_property_pressed:
  98. - :ref:`Texture<class_Texture>` **pressed**
  99. +----------+----------------------------+
  100. | *Setter* | set_texture_pressed(value) |
  101. +----------+----------------------------+
  102. | *Getter* | get_texture_pressed() |
  103. +----------+----------------------------+
  104. The button's texture for the pressed state.
  105. ----
  106. .. _class_TouchScreenButton_property_shape:
  107. - :ref:`Shape2D<class_Shape2D>` **shape**
  108. +----------+------------------+
  109. | *Setter* | set_shape(value) |
  110. +----------+------------------+
  111. | *Getter* | get_shape() |
  112. +----------+------------------+
  113. The button's shape.
  114. ----
  115. .. _class_TouchScreenButton_property_shape_centered:
  116. - :ref:`bool<class_bool>` **shape_centered**
  117. +----------+---------------------------+
  118. | *Setter* | set_shape_centered(value) |
  119. +----------+---------------------------+
  120. | *Getter* | is_shape_centered() |
  121. +----------+---------------------------+
  122. If ``true``, the button's shape is centered.
  123. ----
  124. .. _class_TouchScreenButton_property_shape_visible:
  125. - :ref:`bool<class_bool>` **shape_visible**
  126. +----------+--------------------------+
  127. | *Setter* | set_shape_visible(value) |
  128. +----------+--------------------------+
  129. | *Getter* | is_shape_visible() |
  130. +----------+--------------------------+
  131. If ``true``, the button's shape is visible.
  132. ----
  133. .. _class_TouchScreenButton_property_visibility_mode:
  134. - :ref:`VisibilityMode<enum_TouchScreenButton_VisibilityMode>` **visibility_mode**
  135. +----------+----------------------------+
  136. | *Setter* | set_visibility_mode(value) |
  137. +----------+----------------------------+
  138. | *Getter* | get_visibility_mode() |
  139. +----------+----------------------------+
  140. The button's visibility mode. See ``VISIBILITY_*`` constants.
  141. Method Descriptions
  142. -------------------
  143. .. _class_TouchScreenButton_method_is_pressed:
  144. - :ref:`bool<class_bool>` **is_pressed** **(** **)** const
  145. Returns ``true`` if this button is currently pressed.