Simple Tiled Implementation - STI v1.2.3.0
Re: Simple Tiled Implementation - STI v0.14.1.8
Use object layers for that, not tile layers.
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.14.1.8
Ok, I changed my map to use object layer, it looks better. But I still have the same problem with removing objects from map at runtime. I ended up with following, but how would you do it better?Karai17 wrote:Use object layers for that, not tile layers.
Thanks!
Code: Select all
-- layer is called "objects"; item is the one to be removed (collected)
for k,v in pairs(self.map.layers.objects.objects) do
if v.id == item.id then
table.remove(self.map.layers.objects.objects, k)
end
end
self.map:setObjectSpriteBatches(self.map.layers.objects)
Re: Simple Tiled Implementation - STI v0.14.1.8
Use ipairs, it is way faster. Also make sure to remove the object from map.objects
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.14.1.8
OK, but I still need to call `setObjectSpriteBatches`, right? Is this the correct way?Karai17 wrote:Use ipairs, it is way faster. Also make sure to remove the object from map.objects
thanks
Code: Select all
for k,v in ipairs(map.layers.objects.objects) do
if v.id == item.id then
table.remove(map.layers.objects.objects, k)
end
end
table.remove(map.objects, item.id)
map:setObjectSpriteBatches(map.layers.objects)
Re: Simple Tiled Implementation - STI v0.14.1.8
Pass in the whole layer, not just the objects.
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.14.1.8
it is the layer, it is called "objects" so I guess it is ok. Thanks for your help!Karai17 wrote:Pass in the whole layer, not just the objects.
Re: Simple Tiled Implementation - STI v0.14.1.8
Ah, right. Confusing :p
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.14.1.8
Any chance of staggered isometric support?
Re: Simple Tiled Implementation - STI v0.14.1.8
Sti already supports that.
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.14.1.8
Can you check my map once? I need a wee bit of help.
Also, you said that the draw range support is only for ortho currently.
Also, you said that the draw range support is only for ortho currently.
Rishavs wrote:Hi
I seem to have hit an issue with your lib.
For isometric Staggered map, it is only displaying 21, 21 tiles.
I am attaching the map i used.
my code is here
https://github.com/rishavs/RoguishLove/
and the file where all the map stuff happens is src/_state_Game.lua
Who is online
Users browsing this forum: Google [Bot], pedrollanca and 3 guests