modules/world: make drawDebugViewBox function related to one view

This commit is contained in:
Kazhnuz 2019-05-02 18:27:58 +02:00
parent 5eed16bac4
commit b69ad095ee

View file

@ -301,17 +301,15 @@ function CameraSystem:followActor(id)
end end
end end
function CameraSystem:drawDebugViewBox() function CameraSystem:drawDebugViewBox(id)
for i=1, #self.views.list do local viewx, viewy, vieww, viewh = self:getOnScreenViewCoordinate(id)
local viewx, viewy, vieww, viewh = self:getOnScreenViewCoordinate(i)
utils.graphics.box(viewx, viewy, vieww, viewh) utils.graphics.box(viewx, viewy, vieww, viewh)
local xx, yy = self:getOnScreenViewCenter(id)
local xx, yy = self:getOnScreenViewCenter(i)
love.graphics.line(xx-3, yy, xx+3, yy) love.graphics.line(xx-3, yy, xx+3, yy)
love.graphics.line(xx, yy-3, xx, yy+3) love.graphics.line(xx, yy-3, xx, yy+3)
print(viewx, viewy, vieww, viewh) local string = id .. " x:" .. viewx .. " y:" .. viewy
end love.graphics.print(string, viewx + 4, viewy + 4)
end end
return CameraSystem return CameraSystem