-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain_menu_mode.lua
More file actions
69 lines (53 loc) · 1.61 KB
/
Copy pathmain_menu_mode.lua
File metadata and controls
69 lines (53 loc) · 1.61 KB
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
local GameMode = {}
GameMode.modeName = "Main Menu"
--
-- GAME STATE: Main Menu
--
function GameMode:Init()
menuSprite = newSpriteSheet(love.graphics.newImage("assets/Start Page.png"), 160, 144)
mainMenuCanvas = love.graphics.newCanvas(160, 144)
end
function GameMode:HandleKeyReleased(key, scancode, isrepeat)
end
function GameMode:HandleKeyPressed(key, scancode, isrepeat)
if key == "j" then
SetCurrentGameMode("Play Mode", nil, true)
elseif key == "k" then
love.event.push("quit")
end
end
function GameMode:HandleMousePressed(x, y, button, istouch, presses)
end
function GameMode:HandleMouseReleased(x, y, button, istouch, presses)
end
function GameMode:HandleMouseWheel(x, y)
end
function GameMode:Update(dt)
end
function GameMode:Draw()
love.graphics.setCanvas(mainMenuCanvas)
love.graphics.clear()
love.graphics.setBackgroundColor(55/255,148/255,110/255)
love.graphics.setColor(1,1,1,1)
drawSprite(menuSprite, 1, 0, 0, 0, 1, 1, 0, 0)
love.graphics.setColor(1,1,1,1)
love.graphics.setCanvas()
love.graphics.scale(viewportScale, viewportScale)
love.graphics.draw(mainMenuCanvas)
love.graphics.scale(1/viewportScale, 1/viewportScale)
love.graphics.setBackgroundColor(55/255,148/255,110/255)
love.graphics.setColor(1,1,1,1)
end
function GameMode:TransitionIn()
end
function GameMode:TransitionOut()
end
function GameMode:SetExternalState(globalState, sharedState)
if sharedState ~= nil then
sharedStateRef = sharedState
end
if globalState ~= nil then
globalStateRef = globalState
end
end
return GameMode