CCLabelBMFont error

CCLabelBMFont error
0.0 0



When i init the CCLabelBMFont using labelWithString, it doesn’t show right. I must call setString() again. I think it has some problems with init.

levelLabel = CCLabelBMFont::labelWithString(" “,”ITC_50.fnt“);
You can try to change the space amount.

Yann (2.4 KB)

ITC_50.png (24.8 KB)


A bug in CCLabelBMFont::labelWithString is just fix in the last Friday
Bug #668, and the diff

But I’m not sure if this can help you.
Which platform do you run the code,
* iOS in RetinaMode?
* iOS without RetinaMode?
* Android with auto-scale enabled?
* Android without auto-scale enabled?


hi walzer,
I’m run in IOS Retina. My friend has the same problem with android, But i don’t know about auto-scale. I will try your fix, if have any problem I will tell you.



It’s mainly caused by

line492, fontChar~~>initWithBatchNode;
which should be
bq. fontChar~~>initWithBatchNodeRectInPixels(this, rect);

Wish you a good luck!


Yann Zhao
You should not use CCLabelBMFont with ttf files. You should offer png file to CCLabelBMFont. ttf files work with CCLabelTTF.


hi walzer,

It’s fixed. Thanks a lot.

I think Minggo misunderstand me.