Simple Tiled Implementation - STI v1.2.3.0

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
raidho36
Party member
Posts: 1987
Joined: Mon Jun 17, 2013 12:00 pm

Re: Simple Tiled Implementation - STI v0.16.0.3

Post by raidho36 » Fri Sep 02, 2016 5:00 pm

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

Zireael
Party member
Posts: 139
Joined: Fri Sep 02, 2016 10:52 am

Re: Simple Tiled Implementation - STI v0.16.0.3

Post by Zireael » Fri Sep 02, 2016 6:20 pm

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

Zireael
Party member
Posts: 139
Joined: Fri Sep 02, 2016 10:52 am

Re: Simple Tiled Implementation - STI v0.16.0.3

Post by Zireael » Wed Sep 07, 2016 2:56 pm

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.

User avatar
Karai17
Party member
Posts: 883
Joined: Sun Sep 02, 2012 10:46 pm

Re: Simple Tiled Implementation - STI v0.16.0.3

Post by Karai17 » Wed Sep 07, 2016 3:02 pm

For custom layers, you need to create your own callbacks.
STI - An awesome Tiled library
LÖVE3D - A 3D library for LÖVE 0.10+

Dev Blog | GitHub | excessive ❤ moé

Zireael
Party member
Posts: 139
Joined: Fri Sep 02, 2016 10:52 am

Re: Simple Tiled Implementation - STI v0.16.0.3

Post by Zireael » Wed Sep 07, 2016 3:25 pm

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).

User avatar
Karai17
Party member
Posts: 883
Joined: Sun Sep 02, 2012 10:46 pm

Re: Simple Tiled Implementation - STI v0.16.0.3

Post by Karai17 » Wed Sep 07, 2016 3:38 pm

It is totally there, in the code examples.
STI - An awesome Tiled library
LÖVE3D - A 3D library for LÖVE 0.10+

Dev Blog | GitHub | excessive ❤ moé

Zireael
Party member
Posts: 139
Joined: Fri Sep 02, 2016 10:52 am

Re: Simple Tiled Implementation - STI v0.16.0.3

Post by Zireael » Wed Sep 07, 2016 4:36 pm

I copied the code examples, and it's not working. See the .love I attached to an earlier post.

User avatar
Karai17
Party member
Posts: 883
Joined: Sun Sep 02, 2012 10:46 pm

Re: Simple Tiled Implementation - STI v0.16.0.3

Post by Karai17 » Wed Sep 07, 2016 11:12 pm

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)
STI - An awesome Tiled library
LÖVE3D - A 3D library for LÖVE 0.10+

Dev Blog | GitHub | excessive ❤ moé

User avatar
slime
Solid Snayke
Posts: 2858
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: Simple Tiled Implementation - STI v0.16.0.3

Post by slime » Wed Sep 07, 2016 11:20 pm

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]

User avatar
Karai17
Party member
Posts: 883
Joined: Sun Sep 02, 2012 10:46 pm

Re: Simple Tiled Implementation - STI v0.16.0.3

Post by Karai17 » Wed Sep 07, 2016 11:22 pm

sliiiiiiiiiiiiime!
STI - An awesome Tiled library
LÖVE3D - A 3D library for LÖVE 0.10+

Dev Blog | GitHub | excessive ❤ moé

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests