TweeJump code is bitmapFontAtlasWithString deprecated?

Hi,

I am trying to run TweeJump from SVN R18 and I get this issue:

Error 1 error C2039: ‘bitmapFontAtlasWithString’ : is not a member of ‘cocos2d::CCLabelBMFont’ c:2d-1.0.1-x-0.9.2\cocos2d-1.0.1-x-0.9.2\tweejump-cocos2dx\classes\gamescene.cpp 51
Error 2 error C3861: ‘bitmapFontAtlasWithString’: identifier not found c:2d-1.0.1-x-0.9.2\cocos2d-1.0.1-x-0.9.2\tweejump-cocos2dx\classes\gamescene.cpp 51

So is bitmapFontAtlasWithString deprecated what can I use instead to render ftn?

Thanks!

Use labelWithString.

This page lists deprecated methods:

http://www.cocos2d-x.org/projects/cocos2d-x/wiki/Methods_deprecated_in_cocos2d-101-x-091

Francis

Oh thanks, ill bookmark it! That is very helpful :slight_smile: (/)

If you manage to compile tweejump with the latest cocos2dx (ios/android?), could you share that?

Hi yes I did. It’s a one line change actually.

Error 1 error C2039: ‘bitmapFontAtlasWithString’ : is not a member of ‘cocos2d::CCLabelBMFont’ 2d-1.0.1-x-0.9.2\cocos2d-1.0.1-x-0.9.2\tweejump-cocos2dx\classes\gamescene.cpp 51
Error 2 error C3861: ‘bitmapFontAtlasWithString’: identifier not found 2d-1.0.1-x-0.9.2\cocos2d-1.0.1-x-0.9.2\tweejump-cocos2dx\classes\gamescene.cpp 51

  • bitmapFontAtlasWithString has been deprecated. Please update to use labelWithString

CCLabelBMFont scoreLabel = CCLabelBMFont::labelWithString(“0”, “Images/bitmapFont.fnt”);

Simply change line 52 and that fixes the compilation problems.