godot/doc/classes/TouchScreenButton.xml

72 lines
3.1 KiB
XML
Raw Normal View History

<?xml version="1.0" encoding="UTF-8" ?>
<class name="TouchScreenButton" inherits="Node2D" version="3.2">
<brief_description>
Button for touch screen devices for gameplay use.
</brief_description>
<description>
TouchScreenButton allows you to create on-screen buttons for touch devices. It's intended for gameplay use, such as a unit you have to touch to move.
This node inherits from [Node2D]. Unlike with [Control] nodes, you cannot set anchors on it. If you want to create menus or user interfaces, you may want to use [Button] nodes instead. To make button nodes react to touch events, you can enable the Emulate Mouse option in the Project Settings.
You can configure TouchScreenButton to be visible only on touch devices, helping you develop your game both for desktop and mobile devices.
</description>
<tutorials>
</tutorials>
<methods>
<method name="is_pressed" qualifiers="const">
<return type="bool">
</return>
<description>
2017-10-10 21:31:04 +00:00
Returns [code]true[/code] if this button is currently pressed.
</description>
</method>
</methods>
<members>
<member name="action" type="String" setter="set_action" getter="get_action" default="&quot;&quot;">
2017-10-10 21:31:04 +00:00
The button's action. Actions can be handled with [InputEventAction].
</member>
2019-07-15 18:42:47 +00:00
<member name="bitmask" type="BitMap" setter="set_bitmask" getter="get_bitmask">
2017-10-10 21:31:04 +00:00
The button's bitmask.
</member>
2019-07-15 18:42:47 +00:00
<member name="normal" type="Texture" setter="set_texture" getter="get_texture">
2017-10-10 21:31:04 +00:00
The button's texture for the normal state.
</member>
<member name="passby_press" type="bool" setter="set_passby_press" getter="is_passby_press_enabled" default="false">
If [code]true[/code], pass-by presses are enabled.
</member>
2019-07-15 18:42:47 +00:00
<member name="pressed" type="Texture" setter="set_texture_pressed" getter="get_texture_pressed">
2017-10-10 21:31:04 +00:00
The button's texture for the pressed state.
</member>
2019-07-15 18:42:47 +00:00
<member name="shape" type="Shape2D" setter="set_shape" getter="get_shape">
2017-10-10 21:31:04 +00:00
The button's shape.
</member>
<member name="shape_centered" type="bool" setter="set_shape_centered" getter="is_shape_centered" default="true">
2019-11-08 10:02:22 +00:00
If [code]true[/code], the button's shape is centered in the provided texture. If no texture is used, this property has no effect.
</member>
<member name="shape_visible" type="bool" setter="set_shape_visible" getter="is_shape_visible" default="true">
If [code]true[/code], the button's shape is visible.
</member>
<member name="visibility_mode" type="int" setter="set_visibility_mode" getter="get_visibility_mode" enum="TouchScreenButton.VisibilityMode" default="0">
The button's visibility mode. See [enum VisibilityMode] for possible values.
</member>
</members>
<signals>
<signal name="pressed">
<description>
2017-10-10 21:31:04 +00:00
Emitted when the button is pressed (down).
</description>
</signal>
<signal name="released">
<description>
2017-10-10 21:31:04 +00:00
Emitted when the button is released (up).
</description>
</signal>
</signals>
<constants>
2017-11-24 22:16:30 +00:00
<constant name="VISIBILITY_ALWAYS" value="0" enum="VisibilityMode">
2017-10-10 21:31:04 +00:00
Always visible.
</constant>
2017-11-24 22:16:30 +00:00
<constant name="VISIBILITY_TOUCHSCREEN_ONLY" value="1" enum="VisibilityMode">
2017-10-10 21:31:04 +00:00
Visible on touch screens only.
</constant>
</constants>
</class>