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
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
    platform.apilevel = '2.0'
    -- Steve Arnold
        local W
        local H
        local screen = platform.window
        local width = 6
        local height = 2
        local colornum = 1
        Color = {
            red         = {25500},
            orange      = {2551650},
            yellow      = {2552550},
            green       = {02550},
            realblue    = {00255},
            white       = {255255255},
            black       = {000},
            paleblue    = {0175235},
            navy        = {2020138},
            maroon      = {1705050},
            gray        = {120120120},
            lightgray   = {240240240},
            bluesteel   = {0175235},
            salmon1      = {235230230},
            salmon = {220220250},
            blue = {0155235}
        }
        buttoncolors = { Color.redColor.maroonColor.orangeColor.yellow,
                         Color.greenColor.paleblueColor.bluesteel,                                   
                        Color.blueColor.realblueColor.navy
                        Color.salmon1Color.lightgrayColor.grayColor.black } 
    function on.paint(gc)
       screen = platform.window
        W = screen:width()
        H = screen:height()
        gc:setColorRGB(220220200)
        gc:fillRect(00WH)
         fontSize = math.floor(W/35 + 0.5)
         fontSize = math.floor(fontSize)
         fontSize = fontSize > 6 and fontSize or 7
        gc:setFont("sansserif""i"fontSize)
        gc:setColorRGB(unpack(Color.gray))
        local answer = "This one does not use images"
        local sw0 = gc:getStringWidth(answer)
        gc:drawString(answer0.95*W - sw00.1*H)
X