本文整理汇总了C++中CCMenuItemImage::autorelease方法的典型用法代码示例。如果您正苦于以下问题:C++ CCMenuItemImage::autorelease方法的具体用法?C++ CCMenuItemImage::autorelease怎么用?C++ CCMenuItemImage::autorelease使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCMenuItemImage
的用法示例。
在下文中一共展示了CCMenuItemImage::autorelease方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CCMenuItemImage
CCMenuItemImage * CCMenuItemImage::itemFromNormalImage(const char *normalImage, const char *selectedImage, const char *disabledImage)
{
CCMenuItemImage *pRet = new CCMenuItemImage();
if (pRet && pRet->initFromNormalImage(normalImage, selectedImage, disabledImage, NULL, NULL))
{
pRet->autorelease();
return pRet;
}
CCX_SAFE_DELETE(pRet);
return NULL;
}
示例2: CCMenuItemImage
CCMenuItemImage * CCMenuItemImage::create(const char *normalImage, const char *selectedImage, const char *disabledImage, CCObject* target, SEL_MenuHandler selector)
{
CCMenuItemImage *pRet = new CCMenuItemImage();
if (pRet && pRet->initWithNormalImage(normalImage, selectedImage, disabledImage, target, selector))
{
pRet->autorelease();
return pRet;
}
CC_SAFE_DELETE(pRet);
return NULL;
}
示例3: create
CCMenuItemImage* CCMenuItemImage::create()
{
CCMenuItemImage *pRet = new CCMenuItemImage();
if (pRet && pRet->init())
{
pRet->autorelease();
return pRet;
}
CC_SAFE_DELETE(pRet);
return NULL;
}
示例4: CCMenuItemImage
CCMenuItemImage *CCMenuItemImage::create(CCSpriteFrame* normalFrame, CCSpriteFrame* selectedFrame, CCSpriteFrame* disabledFrame, CCObject* target, SEL_MenuHandler selector)
{
CCMenuItemImage *pRet = new CCMenuItemImage();
if(pRet && pRet->initWithFrames(normalFrame, selectedFrame, disabledFrame, target, selector))
{
pRet->autorelease();
return pRet;
}
CC_SAFE_DELETE(pRet);
return NULL;
}
示例5: create
CCMenuItemImage* TMenuItemImage::create(const char *img, CCObject* target, SEL_MenuHandler selector)
{
CCMenuItemImage *pRet = new TMenuItemImage();
CCTexture2D* ptex = CCTextureCache::sharedTextureCache()->addImage( img );
int tw = ptex->getContentSize().width / 4;
int th = ptex->getContentSize().height;
CCNode* normal = CCSprite::createWithTexture( ptex, CCRect(0, 0, tw, th ) );
CCNode *selected = CCSprite::createWithTexture(ptex, CCRect( tw*2, 0, tw, th) );
CCNode *disabled = CCSprite::createWithTexture( ptex, CCRect( tw*3, 0, tw, th) );
pRet->initWithNormalSprite(normal, selected, disabled, target, selector);
pRet->autorelease();
return pRet;
}