比如在HELLOWORLD的声明里声明一个自己的精灵
class HelloWorld : public cocos2d::Layer
{
public:
// there's no 'id' in cpp, so we recommend returning the class instance pointer
static cocos2d::Scene* createScene();
// Here's a difference. Method 'init' in cocos2d-x returns bool, instead of returning 'id' in cocos2d-iphone
virtual bool init();
// a selector callback
void menuCloseCallback(cocos2d::Ref* pSender);
// implement the "static create()" method manually
CREATE_FUNC(HelloWorld);
Sprite* mySprite;
};
这个 mySprite 精灵 能否自动回收呢?
记得2.2版本里是不建议这么用的!要用getTag找到添加的Node* 才能自动回收?
不知道3.0改了没有?