How to hide FPS numbers in bottom left of screen in Cocos2d
How do I get rid of the numbers in the bottom left of the screen when I am making a cocos2d game? Thi开发者_如何学编程s is probably a newb question, but still.
There is a ShowFPS var in one of the files when you create the initial cocos project. But this should work from anywhere:
[[Director sharedDirector] setDisplayFPS:NO];
if your app delegate.. Look for
[director setDisplayFPS:YES];
change it to
[director setDisplayFPS:NO];
or you can call this anywhere like the previous answer:
[[CCDirector sharedDirector]setDisplayFPS:NO];
Just a heads up for people checking this out at a later date (like me). setDisplayFPS
is deprecated now. Use setDisplayStats
instead.
[[CCDirector sharedDirector] setDisplayStats:NO];
To show it only when compiling for debug:
#if defined (DEBUG)
[[CCDirector sharedDirector] setDisplayFPS:NO];
#endif
in AppDelegate.cpp file, and the applicationDidFinishLaunching method
// turn on display FPS
pDirector->setDisplayStats(true);
change true to false
for cocos2D 3.0
[[CCDirector sharedDirector] setDisplayStats:YES];
In appdelegate.m after didfinishlaunchingoptions.
[startUpOptions setObject:@(NO) forKey:CCSetupShowDebugStats];
setObject:@NO (It is YES by default).
精彩评论