using CCLabelTTF and setString to show questions.

using CCLabelTTF and setString to show questions.
0.0 0


Hi, i am making a program (Multiple Choices Examn) and i have to show a lot of questions each one with four (4) answers. There are 100 questions. I show one every time. With a button i go to next question. I use CCLabelTTF to show the actual question.
When i go to the next question, i change the CCLabelTTF with SetString, and it is quite slow (the wiki sais that it is slow because it creates a new label everytime you change the string). In an android device the f.p.s. go down every time i go to the next question. There is another way to show a label with a lot of text that change with a button? or it is correct to use CCLabelTTF for doing it?. I tried to use CCLabelAtlas but it seems not to recognize the break lines in the text. Sorry for my english and thanks.


Try using CCLabelBMFont

A more detailed answer. You can use CCLabelBMFont as your labels instead of CCLabelTTF. It also has support for word-wrap, etc. You would want to get the BMFont tool ( but for windows only. I cannot find one for Mac.) and the certain font that you like. It will then generate a PNG and an FNT file that you can import on your project.

You can then create a CCLabelBMFont object by using *CCLabelBMFont::create( <INITIAL_TEXT>, <FNT_FILENAME>, <LABEL_WIDTH>, <WRAPPING_METHOD>, )*
Read more about it here:


i will try it. thanks.