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
|
||||
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue