Home ← TI-Nspire Authoring ← Lua Scripting HQ ← Lua and JavaScript
Todo: - Image support - Font size support - Physics support - Toolpallete support - Clipboard - D2Editor - coroutine (possibly not possible) - string functions - keyboard improvements
-- by Marc Garneau, 2012-- piman@telus.net-- http://web.me.com/piman2/PimanNspire/Blog/Blog.html-- presented at T^3 International Conference • Chicago, IL • March 3, 2012-- This is a simple version of using counters to model integers,-- for the purpose of introducing classes in a workshop.-- There are other features I plan to add later; see list at bottom.platform.apilevel = '1.0'Color = {red = {0xFF, 0x00, 0x00},yellow = {0xFF, 0xFF, 0x00},}function reset()-- The Objects list will get new generated counters, but starts with one.Objects = {Circle(xstart, ystartred, W/20, "red",-1),Circle(xstart, ystartyellow, W/20, "yellow",1),}z = 1endfunction on.resize()W = platform.window:width()H = platform.window:height()xstart = 7*W/8xmat = 3*W/4ystartyellow = H/2ystartred = 5*H/6TrackedObject = nil-- TrackOffsetx = 0-- TrackOffsety = 0reset()endCircle = class()function Circle:init(x, y, radius,color,value)self.x = xself.y = yself.radius = radiusself.color = Color[color]