cocos2d-js中怎么删除一个精灵

添加元素时,有Name属性
var child = parent.addChild(label, 1, "元素的名字");
或者给child设置tag
child.setTag("TAG");
然后,就可以从父亲中,获取此子类
var c = parent.getChildByName("元素的名字");

var c = parent.getChildByTag("TAG");
移除元素也很简单:
parent.removeChild(child);

parent.removeChildByTag("TAG");
或者
child.removeFromParent();

原文地址:https://www.cnblogs.com/Siegel/p/5926828.html