Skip to content

Components

VirtualButton

An on-screen button for a touch screen, reporting the same action a gamepad button would — Jump, say. Needs a Panel on the same node: while held it darkens that Panel, or swaps in a Pressed Texture, and draws nothing without one.

On this page

Add it

+ Add node → Virtual Button creates a node with it already on. Already have a node for it? Add component → VirtualButtonComponent.

From a script

A script on the same node writes these fields by name. VirtualButtonComponent is the name to pass.

rgs
set_text("VirtualButtonComponent", "action", "jump");

Fields

FieldScript nameKindDefaultWhat it does
ActionactiontextjumpReported while this button is held.
Pressed Texturepressed_textureassetnoneSwapped in while held.