Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in love.graphics.stencil(function() #1

Open
alli1999 opened this issue May 8, 2020 · 1 comment
Open

Error in love.graphics.stencil(function() #1

alli1999 opened this issue May 8, 2020 · 1 comment

Comments

@alli1999
Copy link

alli1999 commented May 8, 2020

Hey I was currently going through the zelda code and when I run it without making any changes I got this stencil error
Error

src/world/Room.lua:214: Drawing to the stencil buffer with a Canvas active requires either stencil=true or a custom stencil-type Canvas to be used, in setCanvas.

Traceback

[C]: in function 'stencil'
src/world/Room.lua:214: in function 'render'
src/world/Dungeon.lua:152: in function 'render'
src/states/game/PlayState.lua:51: in function 'render'
src/StateMachine.lua:27: in function 'render'
main.lua:58: in function 'draw'
[C]: in function 'xpcall'

@HOuebt
Copy link

HOuebt commented May 8, 2020

It is an issue since LÖVE Version 11.0: https://love2d.org/wiki/love.graphics.stencil.
The solution is in the new push lib. You need the new push lib from: https://github.com/Ulydev/push.
Now you set in love.load:

push:setupCanvas({
    { name = 'stencil_canvas', stencil = true}
})    

and in Room.lua above love.graphics.stencil(function() ... ):

push:setCanvas('stencil_canvas')

That should fix the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants