/ld27

To get this branch, use:
bzr branch http://9ix.org/bzr/ld27

« back to all changes in this revision

Viewing changes to win_view.lua

  • Committer: Josh C
  • Date: 2013-08-25 02:26:10 UTC
  • Revision ID: josh@9ix.org-20130825022610-13j6ydir3gmihiwz
.bzrignore

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
WinView = Subview:extend {
2
 
   onNew = function (self)
3
 
              local boxW = 550
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
9
 
              local nr = 'data/NewRocker-Regular.otf'
10
 
 
11
 
              self.scale = the.app.scale
12
 
 
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{
30
 
                          text = 'You found the shinies!',
31
 
                          x = boxL,
32
 
                          y = boxT + 25,
33
 
                          width = boxW,
34
 
                          font = {nr, 48},
35
 
                          align = 'center',
36
 
                          tint = {0,0,0}
37
 
                       })
38
 
 
39
 
              self:add(Text:new{
40
 
                          text = 'Press Q to quit',
41
 
                          x = boxL,
42
 
                          y = boxT + 100,
43
 
                          width = boxW,
44
 
                          font = {nr, 20},
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,
52
 
                          y = boxT + 130,
53
 
                          width = boxW,
54
 
                          font = {nr, 20},
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
75
 
}