From aaf0b1882b3ca94aee93aa0091183d232d2c2cbb Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Thu, 2 May 2019 16:21:24 +0200 Subject: [PATCH] modules/world: displace the map according to the view relative position --- gamecore/modules/world/baseworld.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gamecore/modules/world/baseworld.lua b/gamecore/modules/world/baseworld.lua index 43f9b51..39e3ff3 100644 --- a/gamecore/modules/world/baseworld.lua +++ b/gamecore/modules/world/baseworld.lua @@ -310,9 +310,10 @@ function BaseWorld:drawMap(id) -- de position de camera pour afficher la carte par rapport à ces infos tx, ty = self.cameras:getViewCoordinate(id) scale = self.cameras:getViewScale(id) or 1 - - tx = math.floor(tx) - ty = math.floor(ty) + vx, vy = self.cameras:getOnScreenViewRelativePosition(id) + print(tx + vx, ty + vy) + tx = math.floor(tx - math.abs(vx)) + ty = math.floor(ty - math.abs(vy)) end if self.haveMap then