class-description NEWS COMMUNITY STORE TUTORIALS SIGN UP LOGIN LOGOUT ROKOJORI NEWSLETTER SIGN UP LOGIN LOGOUT NEWS COMMUNITY STORE TUTORIALS TOGGLE FULLSCREEN VOLLBILD AN/AUS ObjectNodeCanvasItemNode2D 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 [member ProjectSettings.input_devices/pointing/emulate_mouse_from_touch] 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.
Enum VisibilityMode<>():Enum

VISIBILITY_ALWAYS:null = 0
Always visible.


VISIBILITY_TOUCHSCREEN_ONLY:null = 1
Visible on touch screens only.
Signal pressed<>():Signal
Emitted when the button is pressed (down).

Signal released<>():Signal
Emitted when the button is released (up).

set get String action<>():String set get
The button's action. Actions can be handled with InputEventAction.

set get BitMap bitmask<>():BitMap set get
The button's bitmask.

set get bool passby_press<>():bool set get
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.
set get Shape2D shape<>():Shape2D set get
The button's shape.

set get bool shape_centered<>():bool set get
If true, the button's shape is centered in the provided texture. If no texture is used, this property has no effect.

set get bool shape_visible<>():bool set get
If true, the button's shape is visible in the editor.

set get Texture2D texture_normal<>():Texture2D set get
The button's texture for the normal state.

set get Texture2D texture_pressed<>():Texture2D set get
The button's texture for the pressed state.

set get int visibility_mode<>():int set get
The button's visibility mode.

bool is_pressed<>():bool
Returns true if this button is currently pressed.




All social media brands are registrated trademarks and belong to their respective owners.





CONTACT IMPRINT TERMS OF USE PRIVACY © ROKOROJI ® 2021 rokojori.com
CONTACT IMPRINT TERMS OF USE PRIVACY © ROKOROJI ® 2021 rokojori.com
We are using cookies on this site. Read more... Wir benutzen Cookies auf dieser Seite. Mehr lesen...