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.)
NEW: If you would like a taste of Lua without leaving your browser, feel free to visit and explore the Lua JavaScript page. This offers a sampler of documents that you can try by clicking the "run your code" button. You can even try out your own code using the OnLine Lua Script Editor. This work, based on the great efforts of Jim Bauwens from Belgium, is still very much a work in progress... but it does work (mostly) on iOS (iPads and iPhones) and Android tablets, as well as the more usual platforms!
You may also wish to do some Lua scripting on your TI-Nspire handheld. In addition to the excellent Oclua (On-Calculator LUA), developed by Olivier Armand, we now have another option that promises great things: TIDE (TI-Integrated Development Environment), currently in development by Nadrieril Feneanar
. This offers a scripting page and a Lua page, which automatically picks up the script as you write it. Many of the tutorials that follow support these options. 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.construction, 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!
The lessons in this next section require OS 3.2 functionality or higher.
Lesson 21: (3.2) Text Boxes and Rich Text Input
The new and better way to enter and work with text as the user inputs it: Rich Text boxes come alive!
Lesson 22: (3.2) Create Your Own Math and Chem Boxes
Displaying and evaluating mathematics has never been easier now that we can let TI-Nspire MathBoxes take care of the heavy lifting!
Lesson 23: (3.2) Welcome to the Physics Engine! (I)
Based upon the open-source Chipmunk Physics Engine, this powerful new feature adds amazing possibilities to your Nspire scripting and is the perfect tool for creating simulations of all sorts.
Lesson 24: (3.2) Welcome to the Physics Engine! (II)
Bouncing a ball around the screen maybe a very simple simulation, but it can be the start of something much bigger.
Lesson 25: (3.2) Welcome to the Physics Engine! (III)
Bouncing multiple coloured balls around the screen is much more fun.
Lesson 26: (3.2) Welcome to the Physics Engine! (IV)
Adding Segments as Shapes and using these as walls.
Lesson 27: (3.2) Welcome to the Physics Engine! (V)
Polygons as Physics Objects.
Lesson 28: (3.4) Welcome to the iPad!
Scripting for Touch-Enabled Devices.
©2012 Compass Learning Technologies ←Home ← TI-Nspire Authoring ← Lua Scripting HQ