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
onMouseUp = function()
80
the.app.view = GameView:new{newWorld = true}
87
x = boxL + boxW / 2 - buttonWidth / 2,
88
y = boxT + 40 + 2 * lh,
96
background = Fill:new{
99
height = buttonHeight,
101
onMouseUp = function()
108
-- give the buttons a cycle to get out of the T/L corner
111
activate = function (self)
112
the.cursor.visible = false
113
love.mouse.setVisible(true)
114
love.mouse.setGrab(false)
115
love.mouse.setPosition(the.app.width / 2, self.boxT + 10 )
117
Subview.activate(self)
119
close = function (self)
120
the.cursor.visible = true
121
love.mouse.setVisible(false)
122
love.mouse.setGrab(true)
123
love.mouse.setPosition(the.app.width / 2, the.app.height / 2)
127
onUpdate = function (self)
128
if the.keys:justPressed('escape') then
130
elseif the.keys:justPressed('q') then
b'\\ No newline at end of file'