Page 56 of 92

Re: Simple Tiled Implementation - STI v0.16.0.3

Posted: Fri Sep 02, 2016 5:00 pm
by raidho36
Just get Tiled, STI is a loader of Tiled maps.

As for generating atlases, 5 million years worth of google search reveals things like https://www.codeandweb.com/texturepacker

Re: Simple Tiled Implementation - STI v0.16.0.3

Posted: Fri Sep 02, 2016 6:20 pm
by Zireael
I already have Tiled. I tried to follow the tutorial and it seems there is a problem with drawing my layer with the player :( It gets created but doesn't get drawn...

link to a rushed .love: https://www.dropbox.com/s/0nkn9a315qcb6 ... .love?dl=0

Re: Simple Tiled Implementation - STI v0.16.0.3

Posted: Wed Sep 07, 2016 2:56 pm
by Zireael
I walked through the code with the Zerobrane debugger, it seems that the "sprites" layer doesn't have the draw() function at all. Any ideas why that would happen, I was just following the tutorial.

Re: Simple Tiled Implementation - STI v0.16.0.3

Posted: Wed Sep 07, 2016 3:02 pm
by Karai17
For custom layers, you need to create your own callbacks.

Re: Simple Tiled Implementation - STI v0.16.0.3

Posted: Wed Sep 07, 2016 3:25 pm
by Zireael
Karai17 wrote:For custom layers, you need to create your own callbacks.
Why isn't this mentioned anywhere in the tutorial? I followed the tutorial exactly, twice, every time with the same result (or lack of one).

Re: Simple Tiled Implementation - STI v0.16.0.3

Posted: Wed Sep 07, 2016 3:38 pm
by Karai17
It is totally there, in the code examples.

Re: Simple Tiled Implementation - STI v0.16.0.3

Posted: Wed Sep 07, 2016 4:36 pm
by Zireael
I copied the code examples, and it's not working. See the .love I attached to an earlier post.

Re: Simple Tiled Implementation - STI v0.16.0.3

Posted: Wed Sep 07, 2016 11:12 pm
by Karai17
So on line 15, you are trying to create the layer in slot 8 but you don't have 7 other slots like my example did, so ipairs wasn't picking it up. Removing the 8 puts it in the right slot, in this case 3. There is another small issue which is the fault of the tutorial: love.graphics.point seems to no longer exist (sliiiiiime!) so switch it to love.graphics.circle fixes that.

Code: Select all

        -- Temporarily draw a point at our location so we know
        -- that our sprite is offset properly
        love.graphics.circle("fill", math.floor(self.player.x), math.floor(self.player.y), 5)

Re: Simple Tiled Implementation - STI v0.16.0.3

Posted: Wed Sep 07, 2016 11:20 pm
by slime
Karai17 wrote:There is another small issue which is the fault of the tutorial: love.graphics.point seems to no longer exist (sliiiiiime!) so switch it to love.graphics.circle fixes that.
[wiki]love.graphics.points[/wiki]

Re: Simple Tiled Implementation - STI v0.16.0.3

Posted: Wed Sep 07, 2016 11:22 pm
by Karai17
sliiiiiiiiiiiiime!