Hi all,
I had a bug today about a character never showing up using CCLabelBMFont. After some debugging, I found the problem and fixed it locally (I don’t know if it’s the best fix or if there are similar errors elsewhere).
in CCLabelBMFont::createFontChars(), when the characters are initialized there is the following code:
float yOffset = (float) (m_pConfiguration~~>m_uCommonHeight~~ fontDef.yOffset);
As m_uCommonHeight is unsigned, if yOffset is greater than m_uCommonHeight, it given a huge number instead of a negative one. The y position of the character is huge, and of course out of screen.
I fixed it my casting the unsigned int into int.
float yOffset = (float) ((int)m_pConfiguration~~>m_uCommonHeight~~ fontDef.yOffset);
Hoping this helps someone!