The stencil: within an overall rectangle, image based pieces draw over a grid image clipped by a circle.
Code: Select all
scope_stencil = function()
love.graphics.setColor( 0, 0, 0, 255 )
love.graphics.circle( 'fill', 322.5, 319.5, 611)
end
Code: Select all
function love.draw()
--------------------
love.graphics.draw( mainScreen, 0, 0 ) -- the overall background
love.graphics.setColor( 0, 0, 0, 255 )
love.graphics.printf( “Some Text“, 774, 13, 130, "center" )
love.graphics.setColor( 255, 255, 255, 255 )
love.graphics.setStencil( scope_stencil ) -- limit drawing to inside the scope
love.graphics.setColor(255, 255, 255, 255)
love.graphics.draw( maskScreen, 17, 14 ) -- 17, 14 = scope center - is clipped to stencil if test drawn out of center
love.graphics.draw( thimage, img_apts[1], 308, 305 ) -- 308, 305 = central grid
love.graphics.draw( thimage, img_apts[7], 48, 152 ) -- is not clipped outside the stencil !!
love.graphics.setStencil()
end