本文整理汇总了C++中CCLabelTTF::autorelease方法的典型用法代码示例。如果您正苦于以下问题:C++ CCLabelTTF::autorelease方法的具体用法?C++ CCLabelTTF::autorelease怎么用?C++ CCLabelTTF::autorelease使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCLabelTTF
的用法示例。
在下文中一共展示了CCLabelTTF::autorelease方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CCLabelTTF
CCLabelTTF * CCLabelTTF::labelWithString(const char *label, const char *fontName, float fontSize)
{
CCLabelTTF *pRet = new CCLabelTTF();
if(pRet && pRet->initWithString(label, fontName, fontSize))
{
pRet->autorelease();
return pRet;
}
CCX_SAFE_DELETE(pRet)
return NULL;
}
示例2: create
CCLabelTTF* CCLabelTTF::create(const char *string, const cocos2d::CCSize &dimensions, CCTextAlignment hAlignment, CCVerticalTextAlignment vAlignment, const char *fontName, float fontSize)
{
CCLabelTTF *pRet = new CCLabelTTF();
if(pRet && pRet->initWithString(string, dimensions, hAlignment, vAlignment, fontName, fontSize))
{
pRet->autorelease();
return pRet;
}
CC_SAFE_DELETE(pRet);
return NULL;
}
示例3: CCLabelTTF
CCLabelTTF * CCLabelTTF::createWithFontDefinition(const char *string, ccFontDefinition &textDefinition)
{
CCLabelTTF *pRet = new CCLabelTTF();
if(pRet && pRet->initWithStringAndTextDefinition(string, textDefinition))
{
pRet->autorelease();
return pRet;
}
CC_SAFE_DELETE(pRet);
return NULL;
}
示例4: CCLabelTTF
CCLabelTTF * CCLabelTTF::labelWithString(const char *label, const CCSize& dimensions, CCTextAlignment alignment, const char *fontName, float fontSize)
{
CCLabelTTF *pRet = new CCLabelTTF();
if(pRet && pRet->initWithString(label, dimensions, alignment, fontName, fontSize))
{
pRet->autorelease();
return pRet;
}
CC_SAFE_DELETE(pRet);
return NULL;
}
示例5: CCLabelTTF
CCLabelTTF * CCLabelTTF::create()
{
CCLabelTTF * pRet = new CCLabelTTF();
if (pRet && pRet->init())
{
pRet->autorelease();
}
else
{
CC_SAFE_DELETE(pRet);
}
return pRet;
}
示例6: CCLabelTTF
TTFFontInit::TTFFontInit()
{
CCSize s = CCDirector::sharedDirector()->getWinSize();
CCLabelTTF* font = new CCLabelTTF();
font->init();
font->autorelease();
font->setFontName("Marker Felt");
font->setFontSize(48);
font->setString("It is working!");
this->addChild(font);
font->setPosition(ccp(s.width/2,s.height/4*2));
}