Support show object group of Tiled Map.

This commit is contained in:
zhangbin
2016-07-25 15:56:20 +08:00
parent 6df1dac06d
commit 4dd2557e04
5 changed files with 52 additions and 145 deletions
+2 -2
View File
@@ -656,8 +656,8 @@ var TiledMap = cc.Class({
// the tmx object group should be updated
existedGroups.push(child);
var newSGGroup = this._sgNode.getObjectGroup(groupName);
tmxGroup.enabled = newSGGroup.isVisible();
tmxGroup._replaceSgNode(newSGGroup);
tmxGroup.enabled = newSGGroup.isVisible();
}
} else {
otherChildrenInfo.push({child: child, index: child.getSiblingIndex()});
@@ -729,10 +729,10 @@ var TiledMap = cc.Class({
cc.error('Add component TiledLayer into node failed.');
}
node.enabled = sgGroup.isVisible();
addedGroup._replaceSgNode(sgGroup);
node.setSiblingIndex(sgGroup.getLocalZOrder());
node.setAnchorPoint(this.node.getAnchorPoint());
addedGroup.enabled = sgGroup.isVisible();
} else {
existedGroups[theIndex].setSiblingIndex(sgGroup.getLocalZOrder());
}