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
| Field | Script name | Kind | Default | What it does |
|---|---|---|---|---|
| Action | action | text | jump | Reported while this button is held. |
| Pressed Texture | pressed_texture | asset | none | Swapped in while held. |