本文整理汇总了C++中Bird::autorelease方法的典型用法代码示例。如果您正苦于以下问题:C++ Bird::autorelease方法的具体用法?C++ Bird::autorelease怎么用?C++ Bird::autorelease使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bird
的用法示例。
在下文中一共展示了Bird::autorelease方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: create
Bird* Bird::create(const std::string& filename, const std::string& c_plist, const char* c_FileNameFormat, Vec2 P0, Vec2 P1, Vec2 P2, Vec2 P3, float DelayTime, float FlyTime)
{
Bird *sprite = new (std::nothrow) Bird(filename, c_plist, c_FileNameFormat, P0, P1, P2, P3, DelayTime, FlyTime);
if (sprite && sprite->init())
{
sprite->autorelease();
return sprite;
}
CC_SAFE_DELETE(sprite);
return nullptr;
}
示例2: createWithWorld
Bird* Bird::createWithWorld( b2World* world )
{
Bird* result = new Bird();
if (result && result->initWithWorld(world))
{
result->autorelease();
return result;
} else {
delete result;
result = NULL;
return NULL;
}
}
示例3: Bird
Bird * Bird::create( short type )
{
Bird *bird = new Bird();
CCString *name = CCString::createWithFormat("box0%[email protected]",type);
if(bird&&bird->initWithSpriteFrameName(name->getCString()))
{
bird->birdType = type;
bird->autorelease();
CCArray *frames = CCArray::create();
CCString *blinkFrame = CCString::createWithFormat("box0%[email protected]",type);
frames->addObject(CCSpriteFrameCache::sharedSpriteFrameCache()->spriteFrameByName(name->getCString()));
frames->addObject(CCSpriteFrameCache::sharedSpriteFrameCache()->spriteFrameByName(blinkFrame->getCString()));
frames->addObject(CCSpriteFrameCache::sharedSpriteFrameCache()->spriteFrameByName(name->getCString()));
CCAnimation *animation = CCAnimation::createWithSpriteFrames(frames,0.2f);
bird->blinkAct = CCAnimate::create(animation);
bird->blink();
return bird;
}
return NULL;
}