modules/world: scissor the view when attaching the camera

This commit is contained in:
Kazhnuz 2019-04-29 14:12:04 +02:00
parent bc0b1bb87b
commit 1ba74a534d

View file

@ -177,7 +177,9 @@ function CameraSystem:attachView(id)
if (id ~= nil) then if (id ~= nil) then
local cam = self:getViewCam(id) local cam = self:getViewCam(id)
local viewx, viewy, vieww, viewh = self:getOnScreenViewCoordinate(id)
cam:attach() cam:attach()
love.graphics.setScissor(viewx, viewy, vieww, viewh)
end end
end end
@ -185,6 +187,7 @@ function CameraSystem:detachView(id)
if (id ~= nil) then if (id ~= nil) then
local cam = self:getViewCam(id) local cam = self:getViewCam(id)
love.graphics.setScissor( )
cam:detach() cam:detach()
end end
end end