Re: Simple Tiled Implementation - STI v0.7.4
Posted: Sat Jul 26, 2014 4:16 pm
Great library, anyway I've a small problem with it.
Is it possible that all tiles on the map have to be a fixed tile size (i.e 8x8 in my case) to be added to the data table inside every layer?
I use following code to check if anything is inside the data table:
normally this code would add a new pad for x amount of tiles inside the data table, but nothing. if I change "objects" to "level"( thats another tilelayer with 8x8 tiles inside) the pads gets created. Any ideas what causes that ?
Is it possible that all tiles on the map have to be a fixed tile size (i.e 8x8 in my case) to be added to the data table inside every layer?
I use following code to check if anything is inside the data table:
Code: Select all
-- Place pads
for y = 1, #map.layers["objects"].data do
for x = 1, #map.layers["objects"].data[1] do
if map.layers["objects"].data[y][x] then
local sx, sy = map.layers["objects"].data[y][x].w, map.layers["objects"].data[y][x].h
pads[#pads+1] = newPad(x, x*sx-sx, y*sy-2, 48, 2)
end
end
end