本文整理汇总了C++中Scale9Sprite::autorelease方法的典型用法代码示例。如果您正苦于以下问题:C++ Scale9Sprite::autorelease方法的具体用法?C++ Scale9Sprite::autorelease怎么用?C++ Scale9Sprite::autorelease使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Scale9Sprite
的用法示例。
在下文中一共展示了Scale9Sprite::autorelease方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: new
Scale9Sprite* Scale9Sprite::create(const Rect& capInsets,
const std::string& file)
{
Scale9Sprite* pReturn = new (std::nothrow) Scale9Sprite();
if ( pReturn && pReturn->initWithFile(capInsets, file) )
{
pReturn->autorelease();
return pReturn;
}
CC_SAFE_DELETE(pReturn);
return NULL;
}
示例2: new
Scale9Sprite* Scale9Sprite::createWithSpriteFrameName(const std::string& spriteFrameName)
{
Scale9Sprite* ret = new (std::nothrow) Scale9Sprite();
if (ret && ret->initWithSpriteFrameName(spriteFrameName, Rect::ZERO))
{
ret->autorelease();
return ret;
}
CC_SAFE_DELETE(ret);
log("Could not allocate Scale9Sprite()");
return nullptr;
}
示例3: log
Scale9Sprite* Scale9Sprite::createWithSpriteFrameName(const std::string& spriteFrameName)
{
Scale9Sprite* pReturn = new Scale9Sprite();
if ( pReturn && pReturn->initWithSpriteFrameName(spriteFrameName) )
{
pReturn->autorelease();
return pReturn;
}
CC_SAFE_DELETE(pReturn);
log("Could not allocate Scale9Sprite()");
return NULL;
}
示例4: new
Scale9Sprite* Scale9Sprite::resizableSpriteWithCapInsets(const Rect& capInsets) const
{
Scale9Sprite* pReturn = new (std::nothrow) Scale9Sprite();
if ( pReturn && pReturn->init(_scale9Image,
_spriteRect,
_spriteFrameRotated,
Vec2::ZERO,
_originalSize,
capInsets) )
{
pReturn->autorelease();
return pReturn;
}
CC_SAFE_DELETE(pReturn);
return NULL;
}