diff --git a/examples/gameplay/plateform/assets/monkey_lad.lua b/examples/gameplay/plateform/assets/monkey_lad.lua index bbe147e..2ba5233 100644 --- a/examples/gameplay/plateform/assets/monkey_lad.lua +++ b/examples/gameplay/plateform/assets/monkey_lad.lua @@ -2,6 +2,8 @@ return { metadata = { height = 24, width = 32, + ox = 16, + oy = 12, defaultAnim = "idle" }, animations = { diff --git a/gamecore/modules/assets/tileset.lua b/gamecore/modules/assets/tileset.lua index a2f5dff..9c83c4f 100644 --- a/gamecore/modules/assets/tileset.lua +++ b/gamecore/modules/assets/tileset.lua @@ -91,15 +91,21 @@ end function Tileset:drawTile_Grid(i, j, x, y, r, sx, sy, ox, oy, kx, ky) local tileID = self:getTileID_Grid(i, j) + local ox = ox or self.metadata.ox + local oy = oy or self.metadata.oy self.texture:drawQuad(self.quads[tileID], x, y, r, sx, sy, ox, oy, kx, ky) end function Tileset:drawTile(id, x, y, r, sx, sy, ox, oy, kx, ky) + local ox = ox or self.metadata.ox + local oy = oy or self.metadata.oy self.texture:drawQuad(self.quads[id], x, y, r, sx, sy, ox, oy, kx, ky) end function Tileset:drawTileMask_Grid(i, j, x, y, r, sx, sy, ox, oy, kx, ky) local tileID = self:getTileID_Grid(i, j) + local ox = ox or self.metadata.ox + local oy = oy or self.metadata.oy self.texture:drawMaskQuad(self.quads[tileID], x, y, r, sx, sy, ox, oy, kx, ky) end