How to hide FPS numbers in bottom left of screen in Cocos2d

前端 未结 7 2050
囚心锁ツ
囚心锁ツ 2021-02-07 20:46

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.

相关标签:
7条回答
  • 2021-02-07 21:30

    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];
    
    0 讨论(0)
  • 2021-02-07 21:33

    in AppDelegate.cpp file, and the applicationDidFinishLaunching method

    // turn on display FPS
    pDirector->setDisplayStats(true); 
    

    change true to false

    0 讨论(0)
  • 2021-02-07 21:37

    for cocos2D 3.0

    [[CCDirector sharedDirector] setDisplayStats:YES];
    
    0 讨论(0)
  • 2021-02-07 21:38

    To show it only when compiling for debug:

    #if defined (DEBUG)
    [[CCDirector sharedDirector] setDisplayFPS:NO];
    #endif
    
    0 讨论(0)
  • 2021-02-07 21:42

    In appdelegate.m after didfinishlaunchingoptions.

    [startUpOptions setObject:@(NO) forKey:CCSetupShowDebugStats];
    

    setObject:@NO (It is YES by default).

    0 讨论(0)
  • 2021-02-07 21:44

    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];
    
    0 讨论(0)
提交回复
热议问题