1
PauseView = Subview:extend {
2
drawParent = true, --default?
3
onNew = function (self)
6
local boxL = the.app.width / 2 - boxW / 2
7
local boxT = the.app.height / 2 - boxH / 2
8
local boxR = boxL + boxW
9
local boxB = boxT + boxH
12
local lh = 26 -- line height
13
local buttonHeight = lh - 6
14
local buttonWidth = 150
42
x = boxL + boxW / 2 - buttonWidth / 2,
51
background = Fill:new{
54
height = buttonHeight,
56
onMouseUp = function()
64
x = boxL + boxW / 2 - buttonWidth / 2,
67
text = 'Start new game',
73
background = Fill:new{
76
height = buttonHeight,
78
onMouseDown = function()
81
the.app.view = GameView:new()
88
x = boxL + boxW / 2 - buttonWidth / 2,
89
y = boxT + 40 + 2 * lh,
97
background = Fill:new{
100
height = buttonHeight,
102
onMouseDown = function()
109
-- give the buttons a cycle to get out of the T/L corner
112
activate = function (self)
113
the.cursor.visible = false
114
love.mouse.setVisible(true)
115
love.mouse.setGrab(false)
116
love.mouse.setPosition(the.app.width / 2, self.boxT + 10 )
118
Subview.activate(self)
120
close = function (self)
121
the.cursor.visible = true
122
love.mouse.setVisible(false)
123
love.mouse.setGrab(true)
124
love.mouse.setPosition(the.app.width / 2, the.app.height / 2)
128
onUpdate = function (self)
129
if the.keys:justPressed('escape') then
131
elseif the.keys:justPressed('q') then
b'\\ No newline at end of file'