modules/world: add a function to get view relative position

This commit is contained in:
Kazhnuz 2019-05-02 16:19:59 +02:00
parent f1edd118ec
commit 065a67a915

View file

@ -218,6 +218,17 @@ function CameraSystem:getOnScreenViewCoordinate(id)
return viewx, viewy, vieww, viewh return viewx, viewy, vieww, viewh
end end
function CameraSystem:getOnScreenViewRelativePosition(id)
local view = self:getView(id)
local viewx, viewy
local basex, basey = (self.views.basewidth / 2), (self.views.baseheight / 2)
viewx = view.pos.onScreen.x
viewy = view.pos.onScreen.y
return viewx, viewy
end
function CameraSystem:getOnScreenViewCenter(id) function CameraSystem:getOnScreenViewCenter(id)
local view = self:getView(id) local view = self:getView(id)