forked from ruilov/GitClient-Release
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.lua
More file actions
55 lines (48 loc) · 1.12 KB
/
Copy pathMain.lua
File metadata and controls
55 lines (48 loc) · 1.12 KB
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
supportedOrientations(LANDSCAPE_ANY)
-- Main.lua
function setup()
--watch("at")
--clearLocalData()
--TOUCHES = {}
screen = StartScreen()
local username = IO.loadUsername()
if username then
GIT_CLIENT = GitClient(username)
else
GIT_CLIENT = GitClient("")
end
end
function draw()
--at = ElapsedTime
background(0)
screen:draw()
if GLOBAL_SHOWKEYBOARD then
GLOBAL_SHOWKEYBOARD = nil
showKeyboard()
end
--[[
pushStyle()
noStroke()
ellipseMode(CENTER)
local newTouches = {}
local lifeT = .3
for _,elem in ipairs(TOUCHES) do
local dt = ElapsedTime - elem.time
local alpha = math.max((1-dt/lifeT),0)*255
fill(255, 0, 0, alpha)
ellipse(elem.touch.x,elem.touch.y,50,50)
if dt < lifeT then
table.insert(newTouches,elem)
end
end
TOUCHES = newTouches
popStyle()
--]]
end
function touched(t)
--table.insert(TOUCHES,{touch=t,time=ElapsedTime})
screen:touched(t)
end
function keyboard(key)
if screen.keyboard then screen:keyboard(key) end
end