W3cubDocs

/Godot 3.0

TouchScreenButton

Inherits: Node2D < CanvasItem < Node < Object

Category: Core

Brief Description

Button for touch screen devices.

Member Functions

bool is_pressed ( ) const

Signals

pressed ( )

Emitted when the button is pressed (down).

released ( )

Emitted when the button is released (up).

Member Variables

  • String action - The button’s action. Actions can be handled with InputEventAction.
  • BitMap bitmask - The button’s bitmask.
  • Texture normal - The button’s texture for the normal state.
  • bool passby_press - If true passby presses are enabled.
  • Texture pressed - The button’s texture for the pressed state.
  • Shape2D shape - The button’s shape.
  • bool shape_centered - If true the button’s shape is centered.
  • bool shape_visible - If true the button’s shape is visible.
  • VisibilityMode visibility_mode - The button’s visibility mode. See VISIBILITY_* constants.

Enums

enum VisibilityMode

  • VISIBILITY_ALWAYS = 0 — Always visible.
  • VISIBILITY_TOUCHSCREEN_ONLY = 1 — Visible on touch screens only.

Description

Button for touch screen devices. You can set it to be visible on all screens, or only on touch devices.

Member Function Description

bool is_pressed ( ) const

Returns true if this button is currently pressed.

© 2014–2018 Juan Linietsky, Ariel Manzur, Godot Engine contributors
Licensed under the MIT License.
http://docs.godotengine.org/en/3.0/classes/class_touchscreenbutton.html