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.
Simple Tiled Implementation - STI v1.2.3.0
Re: Simple Tiled Implementation - STI v0.6.14
There is a direct lookup!
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!
Code: Select all
local map = sti.new("map")
print(map.tiles[1234].properties)
Thank you for your kind words, I'm glad people are finding my lib useful!
STI - An awesome Tiled library
LÖVE3D - A 3D library for LÖVE 0.10+
Dev Blog | GitHub | excessive ❤ moé
LÖVE3D - A 3D library for LÖVE 0.10+
Dev Blog | GitHub | excessive ❤ moé
-
- Party member
- Posts: 356
- Joined: Wed Jul 03, 2013 4:06 am
Re: Simple Tiled Implementation - STI v0.6.14
Any way we can change the setColor RGB values called before each tile is drawn? For tile based lighting, for example.
Re: Simple Tiled Implementation - STI v0.6.14
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é
LÖVE3D - A 3D library for LÖVE 0.10+
Dev Blog | GitHub | excessive ❤ moé
Re: Simple Tiled Implementation - STI v0.6.14
You could add it as a function, couldn't you? Seems like it would be easy to me.
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
Re: Simple Tiled Implementation - STI v0.6.14
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é
LÖVE3D - A 3D library for LÖVE 0.10+
Dev Blog | GitHub | excessive ❤ moé
Re: Simple Tiled Implementation - STI v0.6.14
What about this function?
https://love2d.org/wiki/SpriteBatch:setColor
The lighting thing should really be handled by shaders though.
https://love2d.org/wiki/SpriteBatch:setColor
The lighting thing should really be handled by shaders though.
Re: Simple Tiled Implementation - STI v0.6.14
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é
LÖVE3D - A 3D library for LÖVE 0.10+
Dev Blog | GitHub | excessive ❤ moé
Re: Simple Tiled Implementation - STI v0.6.14
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.
Check out my blog on gamedev
Re: Simple Tiled Implementation - STI v0.6.14
That's the exact thing I posted and Karai answered it directly above your post.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.
Who is online
Users browsing this forum: Google [Bot] and 3 guests