modules/world: displace the map according to the view relative position
This commit is contained in:
parent
065a67a915
commit
aaf0b1882b
1 changed files with 4 additions and 3 deletions
|
@ -310,9 +310,10 @@ function BaseWorld:drawMap(id)
|
||||||
-- de position de camera pour afficher la carte par rapport à ces infos
|
-- de position de camera pour afficher la carte par rapport à ces infos
|
||||||
tx, ty = self.cameras:getViewCoordinate(id)
|
tx, ty = self.cameras:getViewCoordinate(id)
|
||||||
scale = self.cameras:getViewScale(id) or 1
|
scale = self.cameras:getViewScale(id) or 1
|
||||||
|
vx, vy = self.cameras:getOnScreenViewRelativePosition(id)
|
||||||
tx = math.floor(tx)
|
print(tx + vx, ty + vy)
|
||||||
ty = math.floor(ty)
|
tx = math.floor(tx - math.abs(vx))
|
||||||
|
ty = math.floor(ty - math.abs(vy))
|
||||||
end
|
end
|
||||||
|
|
||||||
if self.haveMap then
|
if self.haveMap then
|
||||||
|
|
Loading…
Reference in a new issue