class_touchscreenbutton.rst 7.4 KB

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