Hello there! I used to try Ceramic Tile Engine to load and use maps made in Tiled Map Editor. There were some short code samples on different web sites so in final I got this:
local ceramic=require("Ceramic") level = {} level.scale = 2.5 level.map = nil function level\_load(id) level.map=ceramic.buildMap("level\_"..tostring(id)..".json") level.map.xScale = level.scale level.map.yScale = level.scale player = level.map.layer["Dynamic"].object["Hero"] level.map:setReferencePoint(display.CenterReferencePoint) level.map.setCameraFocus(player) return true end
It is not fully centered. It might be caused by setting xScale and yScale of the “level.map”. If set it to 1.0 everything will be fine. What should I multiply by “level.scale” to center the camera?