feat(screen): add scissoring functions

This commit is contained in:
Kazhnuz 2019-09-07 21:53:14 +02:00
parent 8e000dbc44
commit c339129566

View file

@ -81,6 +81,19 @@ function ScreenManager:getDimensions()
return self.width, self.height return self.width, self.height
end end
-- SCISSOR FUNCTIONS
-- Simple scissor functions
function ScreenManager:setScissor(x, y, width, height)
local x, y = self:getScreenCoordinate(x, y)
love.graphics.setScissor(x, y, width*self.data.resolution, height*self.data.resolution)
end
function ScreenManager:resetScissor()
love.graphics.setScissor( )
end
-- DRAW FUNCTIONS -- DRAW FUNCTIONS
-- Apply draw functions to the scene -- Apply draw functions to the scene