Problem with tilemap setTileGID()

I’m trying to create a sample game, where using tilemap.
Now I want to change tile of map layer at a fix coordinate, so I call to setTileGID(gid, index), but instead of removing old tile and adding new one, cocos2d just places the new one overlap the old :;qst
How can I fix it? Or is it a cocos2d bug?
FYI: I’m coding on Ubuntu with Webstorm and testing on Google Chrome.
Thank!

I might be wrong, but I recall there are a few bugs with Tiled maps in v2.2.2 that were fixed in the current GitHub version. You could check if using that updated source fixes the problem.

I’m sorry for not being too helpful.

@vietanhvunmv

Hi, Have you verified if the layer you are using setTileGID is the layer where the old tile exist? May be the old tile is just in another layer? If they are in the same layer, then there is a problem in setTileGID.

Huabin

ZippoLag wrote:

I might be wrong, but I recall there are a few bugs with Tiled maps in v2.2.2 that were fixed in the current GitHub version. You could check if using that updated source fixes the problem.

I’m sorry for not being too helpful.

Thanks, I will try it.

pandamicro wrote:

@vietanhvunmv

Hi, Have you verified if the layer you are using setTileGID is the layer where the old tile exist? May be the old tile is just in another layer? If they are in the same layer, then there is a problem in setTileGID.

Huabin

Surely, I have only 1 layer at all.

@vietanhvunmv

In this case, can you give us a online test link? That won’t be easier to debug. Or a section of code that you can reproduce the bug.

Huabin