Home ← TI-Nspire Authoring ← Lua Scripting HQ
TI-Nspire Lua Scripting HQ
Texas Instruments TI-Nspire Scripting Support Page
If you are interested to really get the most out of your TI-Nspire documents, then Lua scripting adds a whole new dimension. Feel free to work through the lessons provided here to get you started with Lua on TI-Nspire - drop me an email if you have any questions, comments or suggestions! Below you will find some documents created using the same skills that you will learn in the tutorials.
In addition to the scripted documents gathered below, feel free to browse some of the amazing sampler documents developed by TI to give a taste of what is possible with Lua.
The lessons that follow are designed as a very gentle introduction to Lua on the TI-Nspire platform. Even those without a programming background should be well able to follow these lessons and finish with a moderate level of competence in creating interactive Lua documents. (Some familiarity with creating interactive documents using TI-Nspire's native tools would be helpful - so you may want to go back to the Online Authoring Classroom and work through some of the introductory tutorials there on using scatterplots, Notes and programs.)
And where to from here? Once you finish these lessons and want to go further, head across to the wonderful Nspired Lua website for their tutorials, documentation and wiki.
Getting Started with Lua and TI-Nspire: Introductory Tutorials
Lesson 1: First Steps with Lua and TI-Nspire
on.paint, gc (graphics context), drawString, setFont, setColorRGB, platform.window:width, platform.window:height
Lesson 2: Creating a Dynamic Table
tables, for loops, getStringWidth, getStringHeight, concatenation (..), displaying multiple lines, var.recall
Lesson 3: Varying the Table Contents
if..then..else..end, equality (==) vs assignment (=), more on var.recall
Lesson 4: Capturing Input in your Lua Page
on.charIn, var.store, on.backspaceKey, string.usub, platform.window:invalidate, setPen, drawPolyLine, drawRect, on.enterKey
Lesson 5: Putting it all together: Some Applications
page setup template, simple quiz document
Lesson 6: Quick Start: Controlling a Point on a Graph page
on.arrowUp, on.arrowDown, on.arrowLeft, on.arrowRight, on.create, timer.start, on.timer
Lesson 7: Quick Start: Working with Images in Lua
image.new, drawImage, image.width, image.height, image.copy, on.resize
Lesson 8: Quick Start: Getting Started with Graphics in Lua
drawLine, fillRect, fillPolygon, drawArc, fillArc, isColorDisplay, setAlpha
Lesson 9: Graphical Shape Numbers
Drawing an array, and varying the grid pattern
Lesson 10: Taking Shape Numbers Further
Putting it all together, on.escapeKey, on.tabKey
Lesson 11: Introducing Classes
class, init, contains, paint, selected, color table, unpack
Lesson 12: Mouse Controls with Classes
on.mouseDown, on.mouseUp, on.mouseMove
Lesson 13: Keyboard Controls with Classes
Using arrowKeys, enterKey, tabKey and escapeKey with classes
Lesson 14: Keyboard Controls with Multiple Classes
Using a table to define multiple classes, #Objects (dimension of table Objects)
Lesson 15: Mouse Controls with Multiple Classes
TrackOffset variables, table.remove, table.insert, cloning selected class objects
Lesson 16: Further Useful Tips and Tricks I
Useful string commands: find, replace (gsub), split: applied to pretty print function for algebra
Lesson 17: Further Useful Tips and Tricks II
math.eval (and all applied to fraction function along with a template for multiple keyPads)
Lesson 18: Further Useful Tips and Tricks III
Adding your own custom menus.
Lesson 19: Guidelines for Lua Nspired Authoring I
WORKING ACROSS PLATFORMS (Create Once Play Everywhere)
1. Display Considerations: Looking Good Everywhere!
Lesson 20: Guidelines for Lua Nspired Authoring II
WORKING ACROSS PLATFORMS (Create Once Play Everywhere)
2. Control Considerations: Working Well Everywhere!
Video DemonstrationTitle Author Description Download TNS/Lua Document
Lua Document Template (Simple)
Steve Arnold Want to quickly and easily replace a Notes page or window with a Lua window that displays the same content? Just use the setup program provided to create your own page. Choose colors, styles, sizes and alignment, and know that students cannot get into the page to change anything. You do NOT need any Lua knowledge at all - no coding required!
Want to replace dynamic math boxes? Just define the contents in a (hidden) Notes window as line1, line2, etc, and these will appear in your Lua page.
Lua Document Template
Steve Arnold What if you want to replace multiple pages in your document - or if you want to create an interactive quiz document using Lua - without the need for any coding at all?
This document allows you to enter the contents of each page into a spreadsheet which can then be thrown away (if all pages are static) or hidden if you wish to use variables.
To turn a page into a quiz page, just enter "?" for one of the lines, and then whatever is typed will be shown on the screen at that line. Enter the correct answer into the "answers" column of the spreadsheet and you can even type specific feedback for that question using the "feedback" column. Easy.
Lua Controls Template
Steve Arnold The addition of classes to your Lua scripting opens up amazing possibilities. Perhaps one of the simplest of these is the addition of mouse controls to complement the keyboard actions, allowing our documents to be used on any of the TI-Nspire platforms.
This template makes it easy to add and to customize arrows and circles which can be used effectively as sliders. Adjust the settings from the spreadsheet page provided or from the code itself.
This document has been optimized for handheld, computer and Player.
Lua KeyPad Template
Steve Arnold Sometimes, the standard keypad just isn't enough.
This template makes it easy to add a keypad to your Lua documents. In fact, it adds two keypads - a mathematical one (which includes a single x2 key) and a QWERTY keypad. The keypad is also a functional calculator as well as simplifying fractions and displaying the roots of polynomials.
This document has been optimized for handheld, computer and Player.
Diffusion through a SemiPermeable Membrane
Steve Arnold, Arun Arya and Ankur Thakkar
Explore the effects of changes to the permeability of a membrane on the movement of random particles.
This document has been optimized for both handheld (using keyboard control - just press arrow keys to control the action - no need to grab anything!) and also for computer and Player (using mouse control - just grab and drag the control point - horizontally to increase and decrease the permeability, up and down to change the number of particles).
Lua Ferris Wheel
Steve Arnold Drag the slider to make the ferris wheel turn, and see the values for height above the ground along the way.
This document is a nice exemplar for creating your own axes and graph using Lua graphics.
This document has been optimized for both handheld (using keyboard control - just press arrow keys to control the action - no need to grab anything!) and also for computer and Player (using mouse control - just grab and drag the control point or click the arrows to turn the ferris wheel.)
Centripetal Motion and the Hammer Throw
Steve Arnold, Arun Arya and Ankur Thakkar Compete in the hammer throw!
Press enter at the right point to release the hammer so that it passes through the target. Use arrow keys to increase or decrease the level of difficulty, and to slow down or speed up the turn.
This document has been optimized for both handheld (using keyboard control - just press arrow keys to control the action - no need to grab anything!) and also for computer and Player (using mouse control - just grab and drag the control point - horizontally to increase and decrease the speed of the turn, up and down to change the size of the target).
Lua Hundreds Chart
Steve Arnold Use left and right arrows to move horizontally and up and down to move in jumps of 10 - study the patterns of factors formed by the different numbers on the hundreds chart.
This document has been optimized for both handheld (using keyboard control - just press arrow keys to control the action - no need to grab anything!) and also for computer and Player (using mouse control - just grab and drag the control points or click the arrows to change the values.)
Operations with Exponents
Jharna De and Steve Arnold
Learn to multiply and divide numbers with exponents using the patterns in this interactive table.
This document has been optimized for both handheld (using keyboard control - just press arrow keys to control the action - no need to grab anything!) and also for computer and Player (using mouse control - just grab and drag the control points - horizontally to increase and decrease the base number, up and down to change the index values).
String Art Explorer
Steve Arnold and Jharna De
Explore the creative side of mathematics with this string art explorer - create your own patterns, and then research the Bezier Curves that underly this.
This document has been optimized for both handheld (using keyboard control - just press arrow keys to control the action - no need to grab anything!) and also for computer and Player (using mouse control - just grab and drag the control points - horizontally to increase and decrease the vertex number, up and down to change the number of strings).
Irrational Numbers: Spiderweb
Jharna De, Bikash Jain, Steve Arnold, Arun Arya and Ankur Thakkar
Build a spiderweb using successive triangles to build the irrational square roots of numbers. See these positioned on the number line.
This document has been optimized for both handheld (using keyboard control - just press arrow keys to control the action - no need to grab anything!) and also for computer and Player (using mouse control - just grab and drag the control point - horizontally to increase and decrease the number value, up and down to change the scale).
Factor Display
Steve Arnold
Visually explore the factors of counting numbers.
This document has been optimized for both handheld (using keyboard control - just press arrow keys to control the action - no need to grab anything!) and also for computer and Player (using mouse control - just grab and drag the control points - horizontally to change the number value).
Shape Numbers
Steve Arnold
Build number patterns using shape numbers: square, rectangular and triangular numbers to give the sums of odd, even and counting numbers.
This document has been optimized for both handheld (using keyboard control - just press arrow keys to control the action - no need to grab anything!) and also for computer and Player (using mouse control - just grab and drag the control point - horizontally to increase and decrease the number value, up and down to build the pattern).
Gravity Explorer (Physics)
Steve Arnold, Arun Arya and Ankur Thakkar
Vary mass and distance between planetary objects, then use data on the planets to calculate the gravitational attraction between each and the Earth.
This document has been optimized for both handheld (using keyboard control - just press arrow keys to control the action - no need to grab anything!) and also for computer and Player (using mouse control - just grab and drag the control point - horizontally to increase and decrease the number value, up and down to build the pattern).
Exploring our Solar System
Steve Arnold
What would it be like to live on Mars? Or Jupiter? Explore information about the planets of our solar system, and compare their conditions with those of our own planet.
This document has been optimized for both handheld (using keyboard control - just press arrow keys to control the action - no need to grab anything!) and also for computer and Player (using mouse control - just grab and drag the control points - horizontally to change the page, up and down to change planets).
Our World
Steve Arnold
Explore information about all 254 nations of the world (as at 2010) Study population, geographic and lifestyle data, compare nations, and search using a wide variety of criteria.
This document has been optimized for both handheld (using keyboard control - just press arrow keys to control the action - no need to grab anything!) and also for computer and Player (using mouse control - just grab and drag the control points - horizontally to change the comparison country, up and down to set the focus nation).
Algebraic Fractions
Steve Arnold Are you tired of seeing fractions displayed badly?
Using this document, just type your fraction or decimal and see it displayed correctly as you type.
Press TAB and see the result of polynomial division for your algebraic fraction.
This document has been optimized for handheld, computer and Player.
Algebraic Factors
Steve Arnold This document demonstrates a way that Lua can be used to support the learning of algebra, even on a nonCAS platform. The quiz prompts students with random quadratic expressions and invites them to enter the factored form.
This document has been optimized for handheld, computer and Player.
CAS with Lua
Steve Arnold My idea of a useful CAS interface for schools would be one in which the student is supported in choosing from the range of actions which are possible for a given algebraic object.
In this document, the students enters an algebraic object and the range of appropriate actions become available. By press enter and escape or by arrowing up and down, the results for each of these actions are displayed. AND because this uses the Polynomial Toolkit, this works just fine on the non-CAS as well as CAS platform.
This document has been optimized for handheld, computer and Player.
Algebra Tiles
Steve Arnold and Marc Garneau An essential part of building strong foundations for algebra in the early years of high school is effective use of concrete manipulatives. Carefully introduced, algebra tiles serve to give students a referent which helps them to make sense of the symbols and manipulations which otherwise may well remain meaningless. Virtual manipulatives until now have been slow and difficult to use, but Lua offers the chance for students to use these tools easily. Click and drag with the mouse, or press TAB to select, then use arrow keys to move the tiles and build algebraic expressions. Rotate the x-tiles by clicking on either end, or by pressing "r".
This document has been optimized for handheld, computer and Player.
©2010 Compass Learning Technologies ←Home ← TI-Nspire Authoring ← Lua Scripting HQ