/ld27

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