bzr branch
http://9ix.org/bzr/ld27
24
by Josh C
oops, actually check in win view |
1 |
WinView = Subview:extend { |
2 |
onNew = function (self) |
|
28
by Josh C
update pause and win screens with ridiculous font |
3 |
local boxW = 550 |
24
by Josh C
oops, actually check in win view |
4 |
local boxH = 190 |
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' |
24
by Josh C
oops, actually check in win view |
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 |
|
24
by Josh C
oops, actually check in win view |
14 |
self:add(Fill:new{ |
15 |
fill = {240,221,58}, |
|
16 |
x = boxL - 16, |
|
17 |
y = boxT - 16, |
|
18 |
width = boxW + 32, |
|
19 |
height = boxH + 32, |
|
20 |
}) |
|
21 |
||
22 |
self:add(Fill:new{ |
|
23 |
fill = {166,44,217}, |
|
24 |
x = boxL, |
|
25 |
y = boxT, |
|
26 |
width = boxW, |
|
27 |
height = boxH, |
|
28 |
}) |
|
29 |
||
30 |
self:add(Text:new{ |
|
28
by Josh C
update pause and win screens with ridiculous font |
31 |
text = 'You found the shinies!', |
24
by Josh C
oops, actually check in win view |
32 |
x = boxL, |
28
by Josh C
update pause and win screens with ridiculous font |
33 |
y = boxT + 25, |
24
by Josh C
oops, actually check in win view |
34 |
width = boxW, |
28
by Josh C
update pause and win screens with ridiculous font |
35 |
font = {nr, 48}, |
24
by Josh C
oops, actually check in win view |
36 |
align = 'center', |
37 |
tint = {0,0,0} |
|
38 |
}) |
|
39 |
||
40 |
self:add(Text:new{ |
|
41 |
text = 'Press Q to quit', |
|
42 |
x = boxL, |
|
28
by Josh C
update pause and win screens with ridiculous font |
43 |
y = boxT + 100, |
24
by Josh C
oops, actually check in win view |
44 |
width = boxW, |
28
by Josh C
update pause and win screens with ridiculous font |
45 |
font = {nr, 20}, |
24
by Josh C
oops, actually check in win view |
46 |
align = 'center', |
47 |
tint = {0,0,0} |
|
48 |
}) |
|
49 |
||
50 |
self:add(Text:new{ |
|
51 |
text = 'Any other key to keep exploring', |
|
52 |
x = boxL, |
|
28
by Josh C
update pause and win screens with ridiculous font |
53 |
y = boxT + 130, |
24
by Josh C
oops, actually check in win view |
54 |
width = boxW, |
28
by Josh C
update pause and win screens with ridiculous font |
55 |
font = {nr, 20}, |
24
by Josh C
oops, actually check in win view |
56 |
align = 'center', |
57 |
tint = {0,0,0} |
|
58 |
}) |
|
59 |
||
60 |
||
61 |
end, |
|
62 |
onUpdate = function (self) |
|
63 |
if the.keys:justPressed('q') then |
|
64 |
if the.profiler then |
|
65 |
the.profiler:stop() |
|
66 |
local outfile = io.open( "profile.txt", "w+" ) |
|
67 |
the.profiler:report( outfile ) |
|
68 |
outfile:close() |
|
69 |
end |
|
70 |
||
71 |
the.app:quit() |
|
72 |
elseif the.keys:allJustPressed() then |
|
73 |
self:deactivate() |
|
74 |
end |
|
75 |
end |
|
38
by Josh C
scaling |
76 |
} |