modules/world: add a function to get view relative position
This commit is contained in:
parent
f1edd118ec
commit
065a67a915
1 changed files with 11 additions and 0 deletions
|
@ -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)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue