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
platform.apilevel = '2.0'-- Steve Arnoldlocal Wlocal Hlocal screen = platform.windowlocal width = 6local height = 2local colornum = 1Color = {red = {255, 0, 0},orange = {255, 165, 0},yellow = {255, 255, 0},green = {0, 255, 0},realblue = {0, 0, 255},white = {255, 255, 255},black = {0, 0, 0},paleblue = {0, 175, 235},navy = {20, 20, 138},maroon = {170, 50, 50},gray = {120, 120, 120},lightgray = {240, 240, 240},bluesteel = {0, 175, 235},salmon1 = {235, 230, 230},salmon = {220, 220, 250},blue = {0, 155, 235}}buttoncolors = { Color.red, Color.maroon, Color.orange, Color.yellow,Color.green, Color.paleblue, Color.bluesteel,Color.blue, Color.realblue, Color.navy,Color.salmon1, Color.lightgray, Color.gray, Color.black }function on.paint(gc)screen = platform.windowW = screen:width()H = screen:height()gc:setColorRGB(220, 220, 200)gc:fillRect(0, 0, W, H)fontSize = math.floor(W/35 + 0.5)fontSize = math.floor(fontSize)fontSize = fontSize > 6 and fontSize or 7gc:setFont("sansserif", "i", fontSize)gc:setColorRGB(unpack(Color.gray))local answer = "This one does not use images"local sw0 = gc:getStringWidth(answer)gc:drawString(answer, 0.95*W - sw0, 0.1*H)