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
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