Page 20 of 92

Re: Simple Tiled Implementation - STI v0.7.4

Posted: Sat Jul 26, 2014 4:16 pm
by MadByte
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:

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
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 ?

Re: Simple Tiled Implementation - STI v0.7.4

Posted: Sat Jul 26, 2014 5:17 pm
by Karai17
STI follows the Tiled spec, so all tiles in a particular map must be the same size.

Re: Simple Tiled Implementation - STI v0.7.4

Posted: Sat Jul 26, 2014 5:35 pm
by MadByte
too bad, thanks for your anwser.
Anyway the tiles get drawn correctly. I read about that method to load images as a whole tile in an tutorial for another framework so I thought it would work as expected.

Re: Simple Tiled Implementation - STI v0.7.4

Posted: Sun Jul 27, 2014 1:26 am
by Karai17
Take a look at the Image Layer type. It's not... Ideal, but it MIGHT do what you want it to do?

Re: Simple Tiled Implementation - STI v0.7.4

Posted: Sun Jul 27, 2014 5:43 am
by MadByte
I already got it to work with the tilelayer. Thanks :)

Re: Simple Tiled Implementation - STI v0.7.5

Posted: Tue Aug 05, 2014 5:27 am
by Karai17
Minor update to fix a couple bugs. Tile Properties should not longer be incorrectly offset and drawing individual layers should work as the documentation suggests.

Re: Simple Tiled Implementation - STI v0.7.5

Posted: Sat Aug 09, 2014 6:35 pm
by martov
with that last update, my tilemap's path's are not longer relative to the root folder, now they appear to be relative to the map's location.

SCREENSHOT here
http://s30.postimg.org/yunvmty2n/Nueva_ ... e_bits.jpg

:o:

Re: Simple Tiled Implementation - STI v0.7.5

Posted: Sat Aug 09, 2014 7:52 pm
by Karai17
Nothing I changed should have any effect on paths. Did you upgrade from 0.7.4 or was it an earlier version?

Re: Simple Tiled Implementation - STI v0.7.5

Posted: Thu Aug 14, 2014 1:49 am
by martov
I replaced the contents of the old STI with the new one.

maybe I did something wrong?, I tested the code and it worked, then I upgraded STI and this happened.

:(

Re: Simple Tiled Implementation - STI v0.7.5

Posted: Thu Aug 14, 2014 3:22 am
by Karai17
Can you send me a .love of your game?