Skip to reading
BASIC Scripting

Connect a button to BASIC

Edition 0.86.4.1 HF1

0.86.4.1 Hotfix 1 edition. Earlier lessons and screenshots retain their original version context; revised references and supplements describe the newer behavior.

Download PDFView illustrations

BASIC IN YOUR GAME

A text box holds the player’s words. A button decides when to read them. A label gives an answer the player can see.

The GUI Designer shows the three elements. The button is selected in GUI Elements.

01. In GUI Designer, select the GUI that contains your controls. The example uses GUI ID station, text box entry, button submit and label reply. The button’s visible caption is “Check direction.”

02. Select the button. In Element Properties → Events, find Click. Set its behavior to run-visual-script and its target to the enabled BASIC record check_word. That behavior accepts a BASIC script ID.

Click and Click Target in the button Inspector. The target names a script record.

Apply the changes and save the project. Use the next page for the code that goes inside check_word. In a game preview, make sure the GUI is open or set to be visible at the start.

Page 18 of 86Permalink
Go to page