Simple Tiled Implementation - STI v1.2.3.0

Showcase your libraries, tools and other projects that help your fellow love users.
Durandle
Prole
Posts: 1
Joined: Wed Feb 19, 2014 12:04 pm

Re: Simple Tiled Implementation - STI v0.6.14

Post by Durandle »

This seems to be something mentioned before, but is there any reason you don't have a direct tile-id to tile-properties lookup table? It seems like something that would be super useful, since when doing a collision check with a tile/object, you may want to check for example the "solid" property of said tile. Or the "reactive" property" Or the "bouncy" property. etc etc etc. Sure I've written my own lookup code, that makes such a table, but seems like something that really should be in-built (and if it is, its not documented).

That being said, this is such a useful module :) and really fast to boot.
User avatar
Karai17
Party member
Posts: 930
Joined: Sun Sep 02, 2012 10:46 pm

Re: Simple Tiled Implementation - STI v0.6.14

Post by Karai17 »

There is a direct lookup!

Code: Select all

local map = sti.new("map")
print(map.tiles[1234].properties)
If you check out my other lib linked in my sig (Peep), then you can more easily view table data to see what potentially undocumented things are lurking about. :)

Thank you for your kind words, I'm glad people are finding my lib useful! :D
STI - An awesome Tiled library
LÖVE3D - A 3D library for LÖVE 0.10+

Dev Blog | GitHub | excessive ❤ moé
pauljessup
Party member
Posts: 356
Joined: Wed Jul 03, 2013 4:06 am

Re: Simple Tiled Implementation - STI v0.6.14

Post by pauljessup »

Any way we can change the setColor RGB values called before each tile is drawn? For tile based lighting, for example.
User avatar
Karai17
Party member
Posts: 930
Joined: Sun Sep 02, 2012 10:46 pm

Re: Simple Tiled Implementation - STI v0.6.14

Post by Karai17 »

Not that I am aware of. You could try using a shader, maybe?
STI - An awesome Tiled library
LÖVE3D - A 3D library for LÖVE 0.10+

Dev Blog | GitHub | excessive ❤ moé
davisdude
Party member
Posts: 1154
Joined: Sun Apr 28, 2013 3:29 am
Location: North Carolina

Re: Simple Tiled Implementation - STI v0.6.14

Post by davisdude »

You could add it as a function, couldn't you? Seems like it would be easy to me. :P
GitHub | MLib - Math and shape intersections library | Walt - Animation library | Brady - Camera library with parallax scrolling | Vim-love-docs - Help files and syntax coloring for Vim
User avatar
Karai17
Party member
Posts: 930
Joined: Sun Sep 02, 2012 10:46 pm

Re: Simple Tiled Implementation - STI v0.6.14

Post by Karai17 »

All the tiles are in sprite batches and are all drawn at once, so it wouldn't really work the way you want it to.
STI - An awesome Tiled library
LÖVE3D - A 3D library for LÖVE 0.10+

Dev Blog | GitHub | excessive ❤ moé
User avatar
qwook
Prole
Posts: 40
Joined: Fri Dec 13, 2013 5:53 am

Re: Simple Tiled Implementation - STI v0.6.14

Post by qwook »

What about this function?
https://love2d.org/wiki/SpriteBatch:setColor

The lighting thing should really be handled by shaders though.
User avatar
Karai17
Party member
Posts: 930
Joined: Sun Sep 02, 2012 10:46 pm

Re: Simple Tiled Implementation - STI v0.6.14

Post by Karai17 »

That seems to be only used when adding a new sprite to the batch, not something you'd use dynamically to adjust lighting. I would recommend using a shader for lighting effects.
STI - An awesome Tiled library
LÖVE3D - A 3D library for LÖVE 0.10+

Dev Blog | GitHub | excessive ❤ moé
User avatar
micha
Inner party member
Posts: 1083
Joined: Wed Sep 26, 2012 5:13 pm

Re: Simple Tiled Implementation - STI v0.6.14

Post by micha »

Haven't tried myself, but it seems with SpriteBatch:setColor you can assign a color to each quad in the batch. First call setColor and after that use "set" on a quad. If I understand the wiki correctly, then this should also change the color.
User avatar
qwook
Prole
Posts: 40
Joined: Fri Dec 13, 2013 5:53 am

Re: Simple Tiled Implementation - STI v0.6.14

Post by qwook »

micha wrote:Haven't tried myself, but it seems with SpriteBatch:setColor you can assign a color to each quad in the batch. First call setColor and after that use "set" on a quad. If I understand the wiki correctly, then this should also change the color.
That's the exact thing I posted and Karai answered it directly above your post.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests