Simple Tiled Implementation - STI v1.2.3.0

Showcase your libraries, tools and other projects that help your fellow love users.
amcoolio
Prole
Posts: 7
Joined: Fri May 27, 2016 1:15 am

Re: Simple Tiled Implementation - STI v0.14.1.13

Post by amcoolio »

bobbyjones wrote:
Karai17 wrote:You need to use math.floor to make sure you are translating and drawing to an internet value.
Integer value I think you mean.
Thanks, that fixed it.

If I wanted to take the bottom most layer (in my case, water) and have it scroll in a loop to the right, so that it looks like the waves are moving, how would I do that? It is currently tiled throughout the whole map. Is there a way to call a specific layer that is already in use? I checked the documentation and didn't see any. Sorry, im a noob at this.
User avatar
Karai17
Party member
Posts: 930
Joined: Sun Sep 02, 2012 10:46 pm

Re: Simple Tiled Implementation - STI v0.14.1.13

Post by Karai17 »

You can either animate tiles, or adjust the layer's x and y position, depending on the effect you're after.
STI - An awesome Tiled library
LÖVE3D - A 3D library for LÖVE 0.10+

Dev Blog | GitHub | excessive ❤ moé
amcoolio
Prole
Posts: 7
Joined: Fri May 27, 2016 1:15 am

Re: Simple Tiled Implementation - STI v0.14.1.13

Post by amcoolio »

I am trying to make a formula for the x and y coordinates, but not having any luck manipulating the x and y coords from the layer in map.lua.

waterlayer = map.layers["watertile"]
x = waterlayer.x
y = waterlayer.y
print(x,y)

This gets the 0,0 cordinates, and when I use the formula the print() changes, however the layer itself doesn't move.

The blue waves to the far right are the bottom most layer in this image, and it is tiled throughout the map, with another water layer painted on top to give the illusion of the water moving. I just want the waves to move slowly to the left infinitely, nothing complicated
Attachments
Untitled-1.jpg
Untitled-1.jpg (511.44 KiB) Viewed 3711 times
User avatar
Karai17
Party member
Posts: 930
Joined: Sun Sep 02, 2012 10:46 pm

Re: Simple Tiled Implementation - STI v0.14.1.13

Post by Karai17 »

try layer.offset.x/y
STI - An awesome Tiled library
LÖVE3D - A 3D library for LÖVE 0.10+

Dev Blog | GitHub | excessive ❤ moé
User avatar
LordSeaworth
Prole
Posts: 22
Joined: Tue Jun 07, 2016 10:29 pm

Re: Simple Tiled Implementation - STI v0.14.1.13

Post by LordSeaworth »

Is this library still up to date'ish with latest löve?
User avatar
Karai17
Party member
Posts: 930
Joined: Sun Sep 02, 2012 10:46 pm

Re: Simple Tiled Implementation - STI v0.14.1.13

Post by Karai17 »

Yes, STI will run on LOVE 0.10.1. The version number of STI refers to the features available from Tiled (as of this date, STI should be fully compatible with Tiled 0.14.1). STI will still work with Tiled 0.16 but newer functionality may not be available yet.
STI - An awesome Tiled library
LÖVE3D - A 3D library for LÖVE 0.10+

Dev Blog | GitHub | excessive ❤ moé
User avatar
LordSeaworth
Prole
Posts: 22
Joined: Tue Jun 07, 2016 10:29 pm

Re: Simple Tiled Implementation - STI v0.14.1.13

Post by LordSeaworth »

Karai17 wrote:Yes, STI will run on LOVE 0.10.1. The version number of STI refers to the features available from Tiled (as of this date, STI should be fully compatible with Tiled 0.14.1). STI will still work with Tiled 0.16 but newer functionality may not be available yet.
Omg the first reply from the 'god' itself.

Thanks for letting me know.
This lib will be a big part of my upcoming project i'm working on.
Was messing with it yesterday and it already seemed great.

PS: I have a few questions about sti.
Would you mind if i ask them here?
User avatar
Karai17
Party member
Posts: 930
Joined: Sun Sep 02, 2012 10:46 pm

Re: Simple Tiled Implementation - STI v0.14.1.13

Post by Karai17 »

Have at it. :)
STI - An awesome Tiled library
LÖVE3D - A 3D library for LÖVE 0.10+

Dev Blog | GitHub | excessive ❤ moé
User avatar
LordSeaworth
Prole
Posts: 22
Joined: Tue Jun 07, 2016 10:29 pm

Re: Simple Tiled Implementation - STI v0.14.1.13

Post by LordSeaworth »

Karai17 wrote:Have at it. :)
Okay.
First off I want to let you know i'm a total noob at this (at this time).
So if i ask a questions that seems stupid please excuse me.

So I'm using STI toghether with bump or atleast thats what the general idea is.
So I've been able to load a sti map and have a bump object on it.
Is it correct that you need to download bump seperatly? right? The plugin in your repository is just a plugin for STI itself right?
I've downloaded latest bump and added that in my libs folder.
If this is incorrect please correct me.

Also when i calculate the 'objects' with world:countItems() i've get a return of 1 wich is correct cause i added one object. with world:add() but how do i make my tiles from sti also be object? Seems they don't get added?
User avatar
Karai17
Party member
Posts: 930
Joined: Sun Sep 02, 2012 10:46 pm

Re: Simple Tiled Implementation - STI v0.14.1.13

Post by Karai17 »

You need to download bump separately, yes. The plugin is simply an interface.

In Tiled, you can set custom properties of basically anything. Layers, tiles, objects, etc. If you set a property called "collidable" and give it the value "true", then when you initialize your physics world, in your case Map:bump_init(), it should detect all of those collidable flags and convert them into physics objects.
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 1 guest