TMXLayer setTileGID method dosen't not work correctly. #631

Closed
suhanlee opened this Issue Nov 11, 2012 · 0 comments

1 participant

@suhanlee

I am making Game Map Tool.
and I found problem using TMXLayer's function.

I did load tmx information from tmx file.
In function test( working that painting map-tile on the map, and erase map-tile repeatedly,
I hava found bug that a few tile don't work correctly( not paint and not erase(blank tile)
ex) 1~5 map-tile in 20 map-tiles.

and also I found gid value is not synchronize drawing routine.
I thought before removing map-tile clause(=if(gid){}) execution, gid value is 0 value.
so i delete that clause temporarily.


[problem situation]
var layer = map.layerNamed("MapLayer"); // MapLayer

        if( tile_button == ID_EMPTY_TILE) {
            console.log("empty_tile");
        }

        console.log(layer.tileGIDAt(coord));

        var parent = layer.getParent();

        layer.setTileGID(tile_button, coord, 1);

[patch]
... ... @@ -374,7 +374,7 @@ cc.TMXLayer = cc.SpriteBatchNode.extend(/** @lends cc.TMXLayer# /{
374 374

375 375 var gid = this.tileGIDAt(pos);
376 376

377 - if (gid) {
377 + // if (gid) {
378 378 var z = pos.x + pos.y * this._layerSize.width;
379 379 var atlasIndex = this._atlasIndexForExistantZ(z);
380 380 // remove tile from GID map
... ... @@ -405,7 +405,7 @@ cc.TMXLayer = cc.SpriteBatchNode.extend(/
* @lends cc.TMXLayer# /{
405 405 }
406 406 }
407 407 }
408 - }
408 + // }
409 409 },
410 410

411 411 /
*

@suhanlee suhanlee closed this Nov 20, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment