I know that changing the text of a CCLabel is really time consuming and hence cannot be done every frame. So how can I achieve this?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
My understanding is that the general recommendation when you have to update a level regularly (for a score or the like) is to use a CCLablBMFont. CCLabelBMFont uses a bitmap font file, so it will only draw to the screen once and then can just replace the numbers or letters as needed. You really shouldn’t be using CCLabelTTF for anything but completely static text, so CCLabelBMFont would be the way to go for you.
*Edit
Before you worry about the images you need to make sure you uncomment these lines in your AppDelagate:
Then when you create your .fnt and .png make sure to create a second .fnt and .png, which is twice is big as the original font you created and append -hd after the name. So your files should look like “original.fnt” “original.png” “original-hd.fnt” “original-hd.png”