In Cocos2d-x, you typically use Cclabelttf to display text:
cclabelttf* Plabel=cclabelttf::create ("This is a Label", "Arial",);
Plabel->setposition (CCP (MSIZE.WIDTH/2,MSIZE.HEIGHT/2));
This->addchild (Plabel);
If you want to use your own design of the text, it will be used Cclabelatlas, the specific use:
Parameters in order: text content, picture, single text width, single text height, default display character
cclabelatlas* plabelatlas=cclabelatlas::create ("0123456789", " Fontsnums.png ", 38,44, ' 0 ');
Plabelatlas->setposition (CCP (MSIZE.WIDTH/2,MSIZE.HEIGHT/2));
Set display text
plabelatlas->setstring ("a");
This->addchild (Plabelatlas);
Effect Chart:
There is also a way to define FNT configuration files through Cclabelbmfont.
cclabelbmfont* plabelfont=cclabelbmfont::create ("Test", "font.fnt");
Source: Http://blog.csdn.net/Vestigge