I’m developing a game where I update the height the player has already gone. this is my code:
self.intScore++;
[self.lblScore setString:[NSString stringWithFormat:@"%d", self.intScore]];
but when I set the lblScore with the current score, the framerate drops from 60fps to 40fps +-
I’m testing with an iPhone 4.
If I comment the [self.lblScore… then the framerate maintains in 60fps, but the score is not updated.
Any recommendations?
Ok, so here is what I done to solve this issue.
I had a function that updated the score every millisecond and yes, that was awful. So I changed the score updating to happen a little less.
I added this to the .h file
and added this to my function on the .m file
By doing that I was able to keep the same score but it gets updated leed times and by doing that, my framerate keeps nice at 60fps 🙂
+1 to @jonmorgan for suggesting the change to CCLabelAtlas.
I tested my new code with CCLabelTTF and CCLabelAtlas and both keep the framerate at 60fps, but running some tests with other parts of the code, CCLabelAtlas is performing much better.