TouchScreenButton

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.

@GodotBaseClass
struct TouchScreenButton {}

Members

Aliases

BaseClasses
alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses)
Undocumented in source.

Enums

Constants
enum Constants
VisibilityMode
enum VisibilityMode

Functions

_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()

Mixins

__anonymous
mixin baseCasts
Undocumented in source.

Properties

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]

The button's bitmask.

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]

The button's shape.

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.

Static functions

_new
TouchScreenButton _new()

Construct a new instance of TouchScreenButton. Note: use memnew!TouchScreenButton instead.

Static variables

_classBindingInitialized
bool _classBindingInitialized;
Undocumented in source.

Structs

GDNativeClassBinding
struct GDNativeClassBinding
Undocumented in source.

Unions

__anonymous
union __anonymous
Undocumented in source.

Variables

_GODOT_internal_name
enum string _GODOT_internal_name;
Undocumented in source.

Mixed In Members

From mixin baseCasts

as
inout(To) as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
inout(To) as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
inout(ToRef) as()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
template opCast(To)
Undocumented in source.
opCast
template opCast(To)
Undocumented in source.
opCast
template opCast(ToRef)
Undocumented in source.
opCast
void* opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
godot_object opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
bool opCast()
Undocumented in source. Be warned that the author may not have intended to support it.

Meta