Creating Lua Applets

Creating Lua Applets

Top  Previous  Next

If you have a TI-Nspire calculator, you can put your Geometry Expressions model on it by creating an interactive Lua app.

Variables can be adjusted from a text box or with a slider. Any points in the Geometry Expressions model constrained by variable Coordinates or a variable parameter for the Point Proportional constraint can be set as draggable points in the Lua app.

After you create your Gx model select File / Export /Lua App. Fill out the details in the Lua App Generator dialog.

Lua dialog 

 

Output directory - tells Gx where to put the file.  It will create a file: name.tns in the specified directory.

Applet Name - is the name of the Lua (.tns) file.

Auto-scale - when set to True, the Lua applet automatically rescales the  drawing when the user changes the value of one of the inputs; when set to False, you are prompted to click-and-drag a rectangle around the drawing after you click Ok.

Inputs - lets you choose which variables the user will be able to change, what text is displayed for the variable and what type of control to use.

Any variables in your Gx model may be selected as input variables in the Lua app.  You can choose whether to use an edit field or a slider to control the variable.

Any points in the Geometry Expressions model constrained by variable Coordinates or a variable parameter for the Point Proportional constraint can be set as draggable points in the Lua app.  These variables, however, cannot be functions or negative; only positive variables are allowed for defining draggable points. I.e., the value of the variable may very well be negative, but using -t as the point proportional parameter or (x, 3*x) as a point's  coordinates will not work.

Outputs - lets you choose which outputs will appear in the applet, and their text Label.

Any measurements which are present in the Geometry Expressions model may be chosen as outputs for the Lua app.  Select True from the Show in Export line.

When you click OK, the Lua code is placed on the clipboard (and also in the file you specified), ready to paste into your TI-Nspire Teacher Software Script Editor.