modules/world: make drawDebugViewBox function related to one view
This commit is contained in:
parent
5eed16bac4
commit
b69ad095ee
1 changed files with 8 additions and 10 deletions
|
@ -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)
|
local string = id .. " x:" .. viewx .. " y:" .. viewy
|
||||||
print(viewx, viewy, vieww, viewh)
|
love.graphics.print(string, viewx + 4, viewy + 4)
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
return CameraSystem
|
return CameraSystem
|
||||||
|
|
Loading…
Reference in a new issue