From b69ad095ee206483a96847101a049e9551c9415d Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Thu, 2 May 2019 18:27:58 +0200 Subject: [PATCH] modules/world: make drawDebugViewBox function related to one view --- gamecore/modules/world/camera.lua | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/gamecore/modules/world/camera.lua b/gamecore/modules/world/camera.lua index 2d889f2..d2e0c15 100644 --- a/gamecore/modules/world/camera.lua +++ b/gamecore/modules/world/camera.lua @@ -301,17 +301,15 @@ function CameraSystem:followActor(id) end end -function CameraSystem:drawDebugViewBox() - for i=1, #self.views.list do - local viewx, viewy, vieww, viewh = self:getOnScreenViewCoordinate(i) - utils.graphics.box(viewx, viewy, vieww, viewh) +function CameraSystem:drawDebugViewBox(id) + local viewx, viewy, vieww, viewh = self:getOnScreenViewCoordinate(id) + utils.graphics.box(viewx, viewy, vieww, viewh) - - local xx, yy = self:getOnScreenViewCenter(i) - love.graphics.line(xx-3, yy, xx+3, yy) - love.graphics.line(xx, yy-3, xx, yy+3) - print(viewx, viewy, vieww, viewh) - end + local xx, yy = self:getOnScreenViewCenter(id) + love.graphics.line(xx-3, yy, xx+3, yy) + love.graphics.line(xx, yy-3, xx, yy+3) + local string = id .. " x:" .. viewx .. " y:" .. viewy + love.graphics.print(string, viewx + 4, viewy + 4) end return CameraSystem