Code referenced:Error
physics.lua:435: Drawing to the stencil buffer with a Canvas active requires either stencil=true or a custom stencil-type Canvas to be used, in setCanvas.
Code: Select all
texCanvas = function( canW, canH, image, x, y, a, sx, sy, wd, ht )
local canvas = love.graphics.newCanvas( canW, canH )
local stencilFunction = function()
gr.polygon( 'fill', polymask )
end
gr.setCanvas( canvas )
gr.stencil( stencilFunction, 'replace', 1 )
gr.setStencilTest( 'greater', 0 )
gr.setColor( 1, 1, 1 )
gr.draw( image, x, y, a, sx, sy, image:getWidth()/2, image:getHeight()/2 )
gr.setStencilTest()
gr.setCanvas()
return canvas
end
Works on Love 10 but not on Love 11.
Where do I stick 'stencil=true' or get a "custom stencil-type Canvas" from?