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
|
PauseView = Subview:extend {
onNew = function (self)
local boxW = 200
local boxH = 90
local boxL = the.app.width / 2 - boxW / 2
local boxT = the.app.height / 2 - boxH / 2
local boxR = boxL + boxW
local boxB = boxT + boxH
local nr = 'data/NewRocker-Regular.otf'
self:add(Fill:new{
fill = {240,221,58},
x = boxL - 16,
y = boxT - 16,
width = boxW + 32,
height = boxH + 32,
})
self:add(Fill:new{
fill = {166,44,217},
x = boxL,
y = boxT,
width = boxW,
height = boxH,
})
self:add(Text:new{
text = 'Quit?',
x = boxL,
y = boxT + 16,
width = boxW,
font = {nr, 24},
align = 'center',
tint = {0,0,0}
})
self:add(Text:new{
text = 'Y/N',
x = boxL,
y = boxT + 48,
width = boxW,
font = {nr, 24},
align = 'center',
tint = {0,0,0}
})
end,
onUpdate = function (self)
if the.keys:justPressed('escape', 'n') then
self:deactivate()
elseif the.keys:justPressed('q', 'y') then
if the.profiler then
the.profiler:stop()
local outfile = io.open( "profile.txt", "w+" )
the.profiler:report( outfile )
outfile:close()
end
the.app:quit()
end
end
}
|