bzr branch
http://9ix.org/bzr/ld27
20
by Josh C
pause/quit screen |
1 |
PauseView = Subview:extend { |
2 |
onNew = function (self) |
|
3 |
local boxW = 200 |
|
4 |
local boxH = 90 |
|
5 |
local boxL = the.app.width / 2 - boxW / 2 |
|
6 |
local boxT = the.app.height / 2 - boxH / 2 |
|
7 |
local boxR = boxL + boxW |
|
8 |
local boxB = boxT + boxH |
|
28
by Josh C
update pause and win screens with ridiculous font |
9 |
local nr = 'data/NewRocker-Regular.otf' |
20
by Josh C
pause/quit screen |
10 |
|
38
by Josh C
scaling |
11 |
self.scale = the.app.scale |
39
by Josh C
propagate scaling / translate properly |
12 |
self.realTranslate = the.app.view.realTranslate |
38
by Josh C
scaling |
13 |
|
20
by Josh C
pause/quit screen |
14 |
self:add(Fill:new{ |
22
by Josh C
win screen (no trigger) |
15 |
fill = {240,221,58}, |
20
by Josh C
pause/quit screen |
16 |
x = boxL - 16, |
17 |
y = boxT - 16, |
|
18 |
width = boxW + 32, |
|
19 |
height = boxH + 32, |
|
20 |
}) |
|
21 |
||
22 |
self:add(Fill:new{ |
|
22
by Josh C
win screen (no trigger) |
23 |
fill = {166,44,217}, |
20
by Josh C
pause/quit screen |
24 |
x = boxL, |
25 |
y = boxT, |
|
26 |
width = boxW, |
|
27 |
height = boxH, |
|
28 |
}) |
|
29 |
||
30 |
self:add(Text:new{ |
|
31 |
text = 'Quit?', |
|
32 |
x = boxL, |
|
33 |
y = boxT + 16, |
|
34 |
width = boxW, |
|
28
by Josh C
update pause and win screens with ridiculous font |
35 |
font = {nr, 24}, |
20
by Josh C
pause/quit screen |
36 |
align = 'center', |
37 |
tint = {0,0,0} |
|
38 |
}) |
|
39 |
||
40 |
self:add(Text:new{ |
|
41 |
text = 'Y/N', |
|
42 |
x = boxL, |
|
43 |
y = boxT + 48, |
|
44 |
width = boxW, |
|
28
by Josh C
update pause and win screens with ridiculous font |
45 |
font = {nr, 24}, |
20
by Josh C
pause/quit screen |
46 |
align = 'center', |
47 |
tint = {0,0,0} |
|
48 |
}) |
|
49 |
||
50 |
||
51 |
end, |
|
52 |
onUpdate = function (self) |
|
53 |
if the.keys:justPressed('escape', 'n') then |
|
42
by Josh C
control by touch ("mouse") |
54 |
if love.system.getOS() == 'Android' then |
55 |
the.app:quit() |
|
56 |
else |
|
20
by Josh C
pause/quit screen |
57 |
self:deactivate() |
42
by Josh C
control by touch ("mouse") |
58 |
end |
20
by Josh C
pause/quit screen |
59 |
elseif the.keys:justPressed('q', 'y') then |
60 |
if the.profiler then |
|
61 |
the.profiler:stop() |
|
62 |
local outfile = io.open( "profile.txt", "w+" ) |
|
63 |
the.profiler:report( outfile ) |
|
64 |
outfile:close() |
|
65 |
end |
|
66 |
||
67 |
the.app:quit() |
|
68 |
end |
|
69 |
end |
|
38
by Josh C
scaling |
70 |
} |