/ld27

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

« back to all changes in this revision

Viewing changes to pause_view.lua

  • Committer: Josh C
  • Date: 2014-07-03 14:41:57 UTC
  • Revision ID: josh@9ix.org-20140703144157-xydxt62xzcdq6bdk
cluke009 zoetrope + my spritebatch changes

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 
9
              local nr = 'data/NewRocker-Regular.otf'
 
10
 
 
11
              self:add(Fill:new{
 
12
                          fill = {240,221,58},
 
13
                          x = boxL - 16,
 
14
                          y = boxT - 16,
 
15
                          width = boxW + 32,
 
16
                          height = boxH + 32,
 
17
                       })
 
18
 
 
19
              self:add(Fill:new{
 
20
                          fill = {166,44,217},
 
21
                          x = boxL,
 
22
                          y = boxT,
 
23
                          width = boxW,
 
24
                          height = boxH,
 
25
                       })
 
26
 
 
27
              self:add(Text:new{
 
28
                          text = 'Quit?',
 
29
                          x = boxL,
 
30
                          y = boxT + 16,
 
31
                          width = boxW,
 
32
                          font = {nr, 24},
 
33
                          align = 'center',
 
34
                          tint = {0,0,0}
 
35
                       })
 
36
 
 
37
              self:add(Text:new{
 
38
                          text = 'Y/N',
 
39
                          x = boxL,
 
40
                          y = boxT + 48,
 
41
                          width = boxW,
 
42
                          font = {nr, 24},
 
43
                          align = 'center',
 
44
                          tint = {0,0,0}
 
45
                       })
 
46
 
 
47
 
 
48
           end,
 
49
   onUpdate = function (self)
 
50
                 if the.keys:justPressed('escape', 'n') then
 
51
                    self:deactivate()
 
52
                 elseif the.keys:justPressed('q', 'y') then
 
53
                    if the.profiler then
 
54
                       the.profiler:stop()
 
55
                       local outfile = io.open( "profile.txt", "w+" )
 
56
                       the.profiler:report( outfile )
 
57
                       outfile:close()
 
58
                    end
 
59
 
 
60
                    the.app:quit()
 
61
                 end
 
62
              end
 
63
}
 
 
b'\\ No newline at end of file'