示例#1
0
CCLabelTTF * CCLabelTTF::create()
{
    CCLabelTTF * pRet = new CCLabelTTF();
    if (pRet && pRet->init())
    {
        pRet->autorelease();
    }
    else
    {
        CC_SAFE_DELETE(pRet);
    }
    return pRet;
}
示例#2
0
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));
}