Still not working, but I dont give up.Karai17 wrote:Looks like you mostly have it. I think the batch id should be in the tile instance, so that will tell you exactly which part of the batch you need to update.
ok, this is what I got so far:
1) mouse click
2) tile-x and tile-y is calculated -> then I look up the GID
Code: Select all
mouse.clickedTile = map.layers[1].data[tiley][tilex].gid
Code: Select all
for i, instance in ipairs(map.tileInstances[mouse.clickedTile]) do
if instance.x/24+1 == tilex and instance.y/24+1 == tiley then
print("GID:",instance.gid,"ID:",instance.id,"i:",i)
mouse.instanceNr = i
end
end
4) Now my plan is to change the quad with this function: .. but it dont works.. why?
Code: Select all
attempt to call method 'setq' (a nil value)
Thanks so much!
zugende