开发者

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).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜