2022-02-21 17:24:20 +00:00
|
|
|
Darkness = {}
|
|
|
|
Canvas = {}
|
|
|
|
|
|
|
|
function Darkness.Create()
|
|
|
|
Darkness.width = game.width/game.scale
|
|
|
|
Darkness.height = game.height/game.scale
|
|
|
|
Canvas.Darkness = love.graphics.newCanvas(
|
|
|
|
Darkness.width,
|
|
|
|
Darkness.height
|
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
function Darkness.Recreate()
|
|
|
|
Canvas.Darkness:release()
|
|
|
|
Darkness.Create()
|
|
|
|
end
|
|
|
|
|
|
|
|
function Darkness.Reset()
|
|
|
|
love.graphics.setCanvas(Canvas.Darkness)
|
|
|
|
love.graphics.setBlendMode("replace")
|
2022-02-21 17:48:24 +00:00
|
|
|
love.graphics.setColor(0,0,0,0.95)
|
2022-02-21 17:24:20 +00:00
|
|
|
love.graphics.rectangle(
|
|
|
|
"fill",
|
|
|
|
0,
|
|
|
|
0,
|
|
|
|
Darkness.width,
|
|
|
|
Darkness.height
|
|
|
|
)
|
|
|
|
love.graphics.setCanvas()
|
|
|
|
end
|
|
|
|
|
|
|
|
function Darkness.DrawStart()
|
|
|
|
Darkness.Reset()
|
|
|
|
love.graphics.setCanvas(Canvas.Darkness)
|
|
|
|
end
|
|
|
|
|
|
|
|
function Darkness.DrawEnd()
|
|
|
|
love.graphics.setCanvas()
|
|
|
|
love.graphics.setBlendMode("alpha")
|
|
|
|
love.graphics.setColor(1,1,1,1)
|
|
|
|
love.graphics.draw(Canvas.Darkness)
|
|
|
|
end
|
|
|
|
|
|
|
|
Darkness.Create()
|