Hi all
Just wondering how I can correct a problem I’m observing with objects created on an object layer in Tiled. The positioning I’m viewing in Tiled is not reproduced within Corona. The positions are offset by x + 32 and y -32.
I.e an object I position at 100, 100 in Tiled has the pixel position (object.x and object.y) of 132, 68. 32 is half the tile width of 64.
Is there a setting I need to configure to positioning elements with a 0,0 anchor for example?
I attach the map and tiles and the code I use to load it is below
map = dusk.buildMap("level\_tilesets/levels.json") map.x = display.contentCenterX - (display.actualContentWidth/2) map.y = display.contentCenterY - (display.actualContentHeight/2) map:scale(1, 1) map.updateView() -- print(pretty.write(object\_layer.visible)) local object\_layer = map.layer["objects"] local tile\_layer = map.layer["level1"] for index, object\_type in ipairs({"wall", "enemy"}) do for object in object\_layer.typeIs(object\_type) do print(object.x .. " " .. object.y .. " " .. object.anchorX .. " " .. object.anchorY) physics.addBody(object, "static") end end