Hello and thank you for taking the time to answer other people’s problems on this forum.
I drag a tile(changing a little things with Graham’s help) and set it, and set the tileImage correctly and everything, but the problem is I cant re-drag it again, and I think the problem is that it’s not really correctly set, because when I debug, it tells me the tile is set on the grass tileLayer(lower z-index), instead of the base(highest z-index) tileLayer. I dont know if Im explaining myself correctly. Here’s the code:
[code]
–Check if there is a base tile on that position
tmpTile = tileImageLayer:getTileAt( endGridPos )
if not tmpTile then
tmpTile = tileImageLayer:createAndBuildTileAt( lastGid, endGridPos )
if not tmpTile then
print(‘What is wrong?’)
else
–it prints tileCreated at layer base, so it should have created and built the tile at the baseLayer
print("tileCreated at layer " … tileImageLayer.name)
tmpTile:show()
end
else
print(“There is tmpTile”)
end
[/code] [import]uid: 109816 topic_id: 20020 reply_id: 320020[/import]