本文整理汇总了C++中Monster::autorelease方法的典型用法代码示例。如果您正苦于以下问题:C++ Monster::autorelease方法的具体用法?C++ Monster::autorelease怎么用?C++ Monster::autorelease使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Monster
的用法示例。
在下文中一共展示了Monster::autorelease方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: create
Monster* Monster::create(const cocos2d::Color4F &color, Vec2 dir)
{
Monster *monster = new Monster;
monster->init(color, dir);
monster->autorelease();
return monster;
}
示例2: create
Monster* Monster::create(const std::string& filename, int cntWidth, int cntHeight) {
Monster *monster = new Monster();
if (monster && monster->initWithFileName(filename, cntWidth, cntHeight) && monster->init()) {
monster->autorelease();
return monster;
}
CC_SAFE_DELETE(monster);
return nullptr;
}
示例3: Monster
Monster *Monster::createWithSpriteFrameName(const char *pszSpriteFrameName)
{
Monster *monster = new Monster();
if (monster && monster->initWithSpriteFrameName(pszSpriteFrameName))
{
monster->autorelease();
return monster;
}
CC_SAFE_DELETE(monster);
return NULL;
}
示例4: create
Monster* Monster::create(const char *pszFileName, int MonsID)
{
Monster *pobSprite = new Monster(MonsID);
if (pobSprite && pobSprite->initWithFile(pszFileName))
{
pobSprite->autorelease();
return pobSprite;
}
CC_SAFE_DELETE(pobSprite);
return NULL;
}
示例5: create
Monster* Monster::create(const std::string& name){
Monster* sprite = new Monster();
if(sprite->initWithFile(name)){
sprite->initOpition();
sprite->autorelease();
return sprite;
}
CC_SAFE_DELETE(sprite);
return nullptr;
}
示例6: new
Monster*Monster::create(Boss_type sprite){
Monster* M = new(std::nothrow) Monster();
if (M && M->init(sprite)) {
M->autorelease();
return M;
}else{
delete M;
M = NULL;
return NULL;
}
}
示例7: create
Monster* Monster::create()
{
Monster* pSprite = new Monster();
if (pSprite->initWithFile("Monster.png"))
{
pSprite->autorelease();
pSprite->initOptions();
pSprite->addEvents();
return pSprite;
}
CC_SAFE_DELETE(pSprite);
return NULL;
}