- _input
void _input(InputEvent arg0)
- getAction
String getAction()
- getBitmask
Ref!BitMap getBitmask()
- getShape
Ref!Shape2D getShape()
- getTexture
Ref!Texture getTexture()
- getTexturePressed
Ref!Texture getTexturePressed()
- getVisibilityMode
TouchScreenButton.VisibilityMode getVisibilityMode()
- isPassbyPressEnabled
bool isPassbyPressEnabled()
- isPressed
bool isPressed()
Returns true if this button is currently pressed.
- isShapeCentered
bool isShapeCentered()
- isShapeVisible
bool isShapeVisible()
- opAssign
typeof(null) opAssign(typeof(null) n)
- opEquals
bool opEquals(TouchScreenButton other)
- opEquals
bool opEquals(typeof(null) n)
- setAction
void setAction(String action)
- setBitmask
void setBitmask(BitMap bitmask)
- setPassbyPress
void setPassbyPress(bool enabled)
- setShape
void setShape(Shape2D shape)
- setShapeCentered
void setShapeCentered(bool _bool)
- setShapeVisible
void setShapeVisible(bool _bool)
- setTexture
void setTexture(Texture texture)
- setTexturePressed
void setTexturePressed(Texture texture_pressed)
- setVisibilityMode
void setVisibilityMode(long mode)
- toHash
size_t toHash()
- action
String action [@property getter]
String action [@property setter]
The button's action. Actions can be handled with InputEventAction.
- bitmask
BitMap bitmask [@property getter]
BitMap bitmask [@property setter]
- normal
Texture normal [@property getter]
Texture normal [@property setter]
The button's texture for the normal state.
- passbyPress
bool passbyPress [@property getter]
bool passbyPress [@property setter]
If true, the pressed and released signals are emitted whenever a pressed finger goes in and out of the button, even if the pressure started outside the active area of the button.
Note: this is a "pass-by" (not "bypass") press mode.
- pressed
Texture pressed [@property getter]
Texture pressed [@property setter]
The button's texture for the pressed state.
- shape
Shape2D shape [@property getter]
Shape2D shape [@property setter]
- shapeCentered
bool shapeCentered [@property getter]
bool shapeCentered [@property setter]
If true, the button's shape is centered in the provided texture. If no texture is used, this property has no effect.
- shapeVisible
bool shapeVisible [@property getter]
bool shapeVisible [@property setter]
If true, the button's shape is visible.
- visibilityMode
TouchScreenButton.VisibilityMode visibilityMode [@property getter]
long visibilityMode [@property setter]
The button's visibility mode. See visibilitymode for possible values.
Button for touch screen devices for gameplay use.
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. Unlike Button, TouchScreenButton supports multitouch out of the box. Several TouchScreenButtons can be pressed at the same time with touch input. 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.