问题
How do I get rid of the numbers in the bottom left of the screen when I am making a cocos2d game? This is probably a newb question, but still.
回答1:
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];
回答2:
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];
回答3:
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];
回答4:
To show it only when compiling for debug:
#if defined (DEBUG)
[[CCDirector sharedDirector] setDisplayFPS:NO];
#endif
回答5:
in AppDelegate.cpp file, and the applicationDidFinishLaunching method
// turn on display FPS
pDirector->setDisplayStats(true);
change true to false
回答6:
for cocos2D 3.0
[[CCDirector sharedDirector] setDisplayStats:YES];
回答7:
In appdelegate.m after didfinishlaunchingoptions.
[startUpOptions setObject:@(NO) forKey:CCSetupShowDebugStats];
setObject:@NO (It is YES by default).
来源:https://stackoverflow.com/questions/5559301/how-to-hide-fps-numbers-in-bottom-left-of-screen-in-cocos2d