From 1ba74a534de282ebcf7e9c0ee95732da34e05dd3 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Mon, 29 Apr 2019 14:12:04 +0200 Subject: [PATCH] modules/world: scissor the view when attaching the camera --- gamecore/modules/world/camera.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gamecore/modules/world/camera.lua b/gamecore/modules/world/camera.lua index d7f6e43..263e4db 100644 --- a/gamecore/modules/world/camera.lua +++ b/gamecore/modules/world/camera.lua @@ -177,7 +177,9 @@ function CameraSystem:attachView(id) if (id ~= nil) then local cam = self:getViewCam(id) + local viewx, viewy, vieww, viewh = self:getOnScreenViewCoordinate(id) cam:attach() + love.graphics.setScissor(viewx, viewy, vieww, viewh) end end @@ -185,6 +187,7 @@ function CameraSystem:detachView(id) if (id ~= nil) then local cam = self:getViewCam(id) + love.graphics.setScissor( ) cam:detach() end end