将CCLabelBMFont添加到cocos2d-x中的sprite中

时间:2014-01-25 09:30:45

标签: cocos2d-x

最近我遇到了一个问题,当我尝试将BMLabelFont添加到精灵时我的程序崩溃了

CCString *coinLabelString = CCString::createWithFormat("%f",health);
healthLabel = CCLabelBMFont::create(coinLabelString->getCString(), kFontChubby, 0);
healthLabel->setPosition(ccp(winSize.width * 0.525, winSize.height * 0.89));
healthLabel->setAnchorPoint(ccp(0, 0.5));
sprite->addChild(healthLabel, 1); 

像这样...我正在添加相同的游戏层及其工作....尝试将其添加到精灵它崩溃与此错误

Cocos2d: createFontChars : cocos2d::CCLabelBMFont: Attempted to use character not defined in this bitmap: 30584
Cocos2d: createFontChars : cocos2d::CCLabelBMFont: Attempted to use character not defined in this bitmap: 4450

这个精灵被添加到一个CCSpriteBatchnode ......它可以创建一个问题......任何解决这个问题....

提前致谢

0 个答案:

没有答案