Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

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

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

suhanlee opened this issue Nov 11, 2012 · 0 comments

Comments

@suhanlee
Copy link
Contributor

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 /

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant