-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstart_menu_view.lua
51 lines (42 loc) · 1.16 KB
/
start_menu_view.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
gui = require 'lib/quickie'
StartMenuView = class("MenuView", View)
gui.core.style.color.normal.bg = {80,180,80}
function StartMenuView:drawContent()
love.graphics.setFont(game.fonts.regular)
gui.core.draw()
local x = 250
local y = 50
if game.graphics.mode.width < 800 then
x = 130
y = 20
end
love.graphics.scale(1.8,1.8)
love.graphics.setColor(255,255,255,200)
love.graphics.print('Rogue Beach, CA', x, y)
love.graphics.setColor(255,200, 10, 255)
love.graphics.print('Rogue Beach, CA', x-1, y-1)
end
function StartMenuView:update(dt)
local x = 100
local y = 50
if game.graphics.mode.width < 800 then
x = 10
y = 20
end
gui.group.push({grow = "down", pos = {x, y}})
-- start the game
if gui.Button({text = '[N]ew game'}) then
game:start()
end
gui.group.push({grow = "down", pos = {0, 20}})
-- fullscreen toggle
if game.graphics.mode.fullscreen then
text = 'Windowed'
else
text = 'Fullscreen'
end
if gui.Button({text = text}) then
game.graphics.fullscreen = not game.graphics.fullscreen
love.graphics.setMode(love.graphics.getWidth(), love.graphics.getHeight(), game.graphics.fullscreen)
end
end