How-to

Make a button run logic

Give a piece of a 2D screen a trigger, so clicking it runs logic.

Before you start

  • Open the screen in the 2D editor: a user interface, a 2D scene or a 2D event. Any piece of it, such as a text, can be the button.

Steps

  1. Click the piece on the canvas, then click Logic at the top of the inspector.
  2. Under Add, click + Trigger, then On Tap End. A section called On Tap End appears.
  3. Next to Trigger Logic, click ✎. The Trigger Logic window opens.
  4. Click Add. In the Result window, next to Outcomes, click Add, and pick what the button does, such as Actions › End Adventure.
  5. Click Save in the Outcome window, then in the Result and Trigger Logic windows.

Check it worked

Under On Tap End, Trigger Logic counts the lines and shows them. Play-test and click the piece: its logic runs. A Quit button with End Adventure brings back the title screen.

A module's Logic tab: On Tap End, with one logic line, End the Current Adventure Execute

Good to know

  • On Tap End runs on a click. The + Trigger menu has 14 kinds, such as On Tap Start, On Mouse Enter, While Hovering, On Drag Start and On Input Press (a key).
  • × beside a trigger's name removes it.
  • With Let Clicks Through on, clicks go to whatever is under the piece, and its click triggers don't run.

See also

Checked against main 9bb38dc, 2026-12-03Report a problem with this page