-
Notifications
You must be signed in to change notification settings - Fork 144
Expand file tree
/
Copy pathinit.lua
More file actions
47 lines (36 loc) · 1.09 KB
/
init.lua
File metadata and controls
47 lines (36 loc) · 1.09 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
--[[ Multiple canvases and shaders ]]--
return function ()
love.graphics.setDefaultFilter("linear", "linear") --default filter
local gameWidth, gameHeight = 800, 600
local windowWidth, windowHeight = love.window.getDesktopDimensions()
windowWidth, windowHeight = windowWidth*.5, windowHeight*.5
push:setupScreen(gameWidth, gameHeight, windowWidth, windowHeight, {
fullscreen = false,
resizable = true,
highdpi = true,
canvas = true
})
time = 0
function love.load()
push:setupCanvas({
{ name = "main" },
{ name = "retained", retain = true } --canvas will not be cleared by push.finish()
})
end
local canvasRendered = false
function love.update(dt)
if not canvasRendered then
push:setCanvas("retained")
love.graphics.rectangle("fill", 25, 25, 105, 100)
push:setCanvas("main")
canvasRendered = true
end
end
function love.draw()
push:start()
push:setCanvas("main")
love.graphics.rectangle('fill', 25, 130, 50, 50)
love.graphics.rectangle('fill', 80, 130, 50, 50)
push:finish()
end
end