//LabelBMFont - Creation & Init CCLabelBMFont *CCLabelBMFont::labelWithString(const char *str, const char *fntFile) { CCLabelBMFont *pRet = new CCLabelBMFont(); if(pRet && pRet->initWithString(str, fntFile)) { pRet->autorelease(); return pRet; } CC_SAFE_DELETE(pRet) return NULL; }
BMFontInit::BMFontInit() { CCSize s = CCDirector::sharedDirector()->getWinSize(); CCLabelBMFont* bmFont = new CCLabelBMFont(); bmFont->init(); bmFont->autorelease(); //CCLabelBMFont* bmFont = [CCLabelBMFont create:@"Foo" fntFile:@"arial-unicode-26.fnt"]; bmFont->setFntFile("fonts/helvetica-32.fnt"); bmFont->setString("It is working!"); this->addChild(bmFont); bmFont->setPosition(ccp(s.width/2,s.height/4*2)); }