-
Notifications
You must be signed in to change notification settings - Fork 3.1k
/
Copy pathGT_clip.lua
90 lines (74 loc) · 2.12 KB
/
GT_clip.lua
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
-- luacheck: globals T r disp millis lcg_rnd
local M, module = {}, ...
_G[module] = M
function M.run()
-- make this a volatile module:
package.loaded[module] = nil
print("Running component clip...")
disp:setColor(0, 0x00, 0xd1, 0x5e) -- dark green
disp:setColor(1, 0xff, 0xf7, 0x61) -- yellow
disp:setColor(2, 0xd1, 0xc7, 0x00) -- dark yellow
disp:setColor(3, 0x61, 0xff, 0xa8) -- green
disp:drawGradientBox(0, 0, disp:getWidth(), disp:getHeight())
disp:setColor(255, 255, 255)
disp:setPrintPos(2,18)
disp:setPrintDir(0)
disp:print("ClipRange")
disp:setColor(0xd1, 0x00, 0x073)
disp:setFont(ucg.font_helvB18_hr)
disp:setPrintPos(25,45)
disp:setPrintDir(0)
disp:print("Ucg")
disp:setPrintDir(1)
disp:print("Ucg")
disp:setPrintDir(2)
disp:print("Ucg")
disp:setPrintDir(3)
disp:print("Ucg")
disp:setMaxClipRange()
disp:setColor(0xff, 0xff, 0xff)
disp:drawFrame(20-1,30-1,15+2,20+2)
disp:setClipRange(20, 30, 15, 20)
disp:setColor(0xff, 0x61, 0x0b8)
disp:setPrintPos(25,45)
disp:setPrintDir(0)
disp:print("Ucg")
disp:setPrintDir(1)
disp:print("Ucg")
disp:setPrintDir(2)
disp:print("Ucg")
disp:setPrintDir(3)
disp:print("Ucg")
disp:setMaxClipRange()
disp:setColor(0xff, 0xff, 0xff)
disp:drawFrame(60-1,35-1,25+2,18+2)
disp:setClipRange(60, 35, 25, 18)
disp:setColor(0xff, 0x61, 0x0b8)
disp:setPrintPos(25,45)
disp:setPrintDir(0)
disp:print("Ucg")
disp:setPrintDir(1)
disp:print("Ucg")
disp:setPrintDir(2)
disp:print("Ucg")
disp:setPrintDir(3)
disp:print("Ucg")
disp:setMaxClipRange()
disp:setColor(0xff, 0xff, 0xff)
disp:drawFrame(7-1,58-1,90+2,4+2)
disp:setClipRange(7, 58, 90, 4)
disp:setColor(0xff, 0x61, 0x0b8)
disp:setPrintPos(25,45)
disp:setPrintDir(0)
disp:print("Ucg")
disp:setPrintDir(1)
disp:print("Ucg")
disp:setPrintDir(2)
disp:print("Ucg")
disp:setPrintDir(3)
disp:print("Ucg")
disp:setFont(ucg.font_ncenR14_hr)
disp:setMaxClipRange()
print("...done")
end
return M