I am looking to persistently display a game score in an iPhone app using cocos2d. Going off the code that cocos2d shows the FPS the app is running at:
-(void) showFPS
{
frames++;
accumDt += dt;
if ( accumDt > 0.1) {
frameRate = frames/accumDt;
frames = 0;
accumDt = 0;
}
NSString *str = [NSString stringWithFormat:@"%.1f",frameRate];
[FPSLabel setString:str];
[FPSLabel draw];
}
I can get the score to display properly, but it flickers, even though the app is running at faster that 60 FPS... Any ideas?
Thanks in advance!