I did not use lua export at all until yesterday so I don't notice it ealier. The columns field is not present in lua export. I find this code useful for me:
local function loadTileset(num)
local tileset = tilesets[num]
local tsiw, tsih = tileset.imagewidth, tileset.imageheight
local margin, spacing = tileset.margin or 0, tileset.spacing or 0
local w, h = tileset.tilewidth, tileset.tileheight
local columns = (tsiw - margin + spacing) / (w + spacing) -- Added code
local gid = 0
local options = {
frames = {},
sheetContentWidth = tsiw,
sheetContentHeight = tsih,
}
local frames = options.frames
local tsh = tileset.tilecount / columns -- Added code
local tsw = columns -- Added code
...
}
Of course, the columns field is present in external tilesets (*.tsx).
Hi,
I did not use lua export at all until yesterday so I don't notice it ealier. The columns field is not present in lua export. I find this code useful for me:
Of course, the columns field is present in external tilesets (*.tsx).
Have a nice day:) ldurniat