-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.lua
40 lines (31 loc) · 944 Bytes
/
main.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
local ScreenManager = require("Yonder").ScreenManager
local defaultGameResolution = {x=1980,y=1080}
function love.load()
love.window.setTitle("Your Yonder App")
ScreenManager:SwitchStates("exampleScreen")
end
function love.draw()
local dimX, dimY = love.graphics.getDimensions()
love.graphics.push()
love.graphics.scale(dimX/defaultGameResolution.x, dimY/defaultGameResolution.y)
ScreenManager:Draw()
love.graphics.pop()
end
function love.update(dt)
ScreenManager:Update(dt)
end
function love.keypressed(key)
ScreenManager:KeyPressed(key)
end
function love.keyreleased(key)
ScreenManager:KeyReleased(key)
end
function love.mousepressed(x, y, button)
ScreenManager:MousePressed(x, y, button)
end
function love.mousereleased(x, y, button)
ScreenManager:MouseReleased(x, y, button)
end
function love.mousemoved(x, y, dx, dy, istouch)
ScreenManager:MouseMoved(x, y, dx, dy, istouch)
end