class_touchscreenbutton.rst 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  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>` | false |
  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>` | true |
  29. +--------------------------------------------------------------+--------------------------------------------------------------------------+-------+
  30. | :ref:`bool<class_bool>` | :ref:`shape_visible<class_TouchScreenButton_property_shape_visible>` | true |
  31. +--------------------------------------------------------------+--------------------------------------------------------------------------+-------+
  32. | :ref:`VisibilityMode<enum_TouchScreenButton_VisibilityMode>` | :ref:`visibility_mode<class_TouchScreenButton_property_visibility_mode>` | 0 |
  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. .. _class_TouchScreenButton_signal_released:
  45. - **released** **(** **)**
  46. Emitted when the button is released (up).
  47. Enumerations
  48. ------------
  49. .. _enum_TouchScreenButton_VisibilityMode:
  50. .. _class_TouchScreenButton_constant_VISIBILITY_ALWAYS:
  51. .. _class_TouchScreenButton_constant_VISIBILITY_TOUCHSCREEN_ONLY:
  52. enum **VisibilityMode**:
  53. - **VISIBILITY_ALWAYS** = **0** --- Always visible.
  54. - **VISIBILITY_TOUCHSCREEN_ONLY** = **1** --- Visible on touch screens only.
  55. Description
  56. -----------
  57. Button for touch screen devices. You can set it to be visible on all screens, or only on touch devices.
  58. Property Descriptions
  59. ---------------------
  60. .. _class_TouchScreenButton_property_action:
  61. - :ref:`String<class_String>` **action**
  62. +-----------+-------------------+
  63. | *Default* | "" |
  64. +-----------+-------------------+
  65. | *Setter* | set_action(value) |
  66. +-----------+-------------------+
  67. | *Getter* | get_action() |
  68. +-----------+-------------------+
  69. The button's action. Actions can be handled with :ref:`InputEventAction<class_InputEventAction>`.
  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. .. _class_TouchScreenButton_property_normal:
  79. - :ref:`Texture<class_Texture>` **normal**
  80. +----------+--------------------+
  81. | *Setter* | set_texture(value) |
  82. +----------+--------------------+
  83. | *Getter* | get_texture() |
  84. +----------+--------------------+
  85. The button's texture for the normal state.
  86. .. _class_TouchScreenButton_property_passby_press:
  87. - :ref:`bool<class_bool>` **passby_press**
  88. +-----------+---------------------------+
  89. | *Default* | false |
  90. +-----------+---------------------------+
  91. | *Setter* | set_passby_press(value) |
  92. +-----------+---------------------------+
  93. | *Getter* | is_passby_press_enabled() |
  94. +-----------+---------------------------+
  95. If ``true``, pass-by presses are enabled.
  96. .. _class_TouchScreenButton_property_pressed:
  97. - :ref:`Texture<class_Texture>` **pressed**
  98. +----------+----------------------------+
  99. | *Setter* | set_texture_pressed(value) |
  100. +----------+----------------------------+
  101. | *Getter* | get_texture_pressed() |
  102. +----------+----------------------------+
  103. The button's texture for the pressed state.
  104. .. _class_TouchScreenButton_property_shape:
  105. - :ref:`Shape2D<class_Shape2D>` **shape**
  106. +----------+------------------+
  107. | *Setter* | set_shape(value) |
  108. +----------+------------------+
  109. | *Getter* | get_shape() |
  110. +----------+------------------+
  111. The button's shape.
  112. .. _class_TouchScreenButton_property_shape_centered:
  113. - :ref:`bool<class_bool>` **shape_centered**
  114. +-----------+---------------------------+
  115. | *Default* | true |
  116. +-----------+---------------------------+
  117. | *Setter* | set_shape_centered(value) |
  118. +-----------+---------------------------+
  119. | *Getter* | is_shape_centered() |
  120. +-----------+---------------------------+
  121. If ``true``, the button's shape is centered.
  122. .. _class_TouchScreenButton_property_shape_visible:
  123. - :ref:`bool<class_bool>` **shape_visible**
  124. +-----------+--------------------------+
  125. | *Default* | true |
  126. +-----------+--------------------------+
  127. | *Setter* | set_shape_visible(value) |
  128. +-----------+--------------------------+
  129. | *Getter* | is_shape_visible() |
  130. +-----------+--------------------------+
  131. If ``true``, the button's shape is visible.
  132. .. _class_TouchScreenButton_property_visibility_mode:
  133. - :ref:`VisibilityMode<enum_TouchScreenButton_VisibilityMode>` **visibility_mode**
  134. +-----------+----------------------------+
  135. | *Default* | 0 |
  136. +-----------+----------------------------+
  137. | *Setter* | set_visibility_mode(value) |
  138. +-----------+----------------------------+
  139. | *Getter* | get_visibility_mode() |
  140. +-----------+----------------------------+
  141. The button's visibility mode. See :ref:`VisibilityMode<enum_TouchScreenButton_VisibilityMode>` for possible values.
  142. Method Descriptions
  143. -------------------
  144. .. _class_TouchScreenButton_method_is_pressed:
  145. - :ref:`bool<class_bool>` **is_pressed** **(** **)** const
  146. Returns ``true`` if this button is currently pressed.