Hi guys,
I just started with Cocos2D 2 days ago writing a simple game, and so far it has been an absolute breeze, I really enjoy the API and the way it works, great job! I do have a (relatively minor) issue right now, and I can't seem to find anything about it on the forum or elsewhere on the internet. The problem is that the FPS counter does not show, even though I enabled it. Not in the simulator, not on the device. Otherwise everything is working as expected (ie: the Director fires, the scene I'm displaying gets updated, etc).
I used the sample code on the Wiki to setup my scene like this:
-(BOOL) application: (UIApplication *) application didFinishLaunchingWithOptions: (NSDictionary *) launchOptions
{
// Forcibly hide the status bar, since I can't get the damn thing to disappear just
// by setting the 'None' property in the UI Builder
[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:NO];
// The following code is all Cocos2D view/buffer setup
[CCDirector setDirectorType:kCCDirectorTypeDisplayLink];
_director = [CCDirector sharedDirector];
[_director setDeviceOrientation:kCCDeviceOrientationLandscapeLeft];
[_director setAnimationInterval:10];
[_director setDisplayFPS:YES];
EAGLView *glView = [EAGLView viewWithFrame:[self.window bounds]
pixelFormat:kEAGLColorFormatRGBA8
depthFormat:GL_DEPTH_COMPONENT24_OES
preserveBackbuffer:NO];
[_director setOpenGLView:glView];
[CCTexture2D setDefaultAlphaPixelFormat:kCCTexture2DPixelFormat_RGBA8888];
/// \todo this is iPhone-4 specific, need to check on actual hardware
//
// [director setContentScaleFactor:2];
[self.window addSubview:glView];
[self.window makeKeyAndVisible];
// Create the 'maze' scene and set a maze on it
//
/// \todo in the finished game, the first scene to display should of course
/// not be the maze itself, but a title screen or something similar
_scene = [AnonMazeScene node];
AnonMaze *maze = [[[AnonMaze alloc] initWithWidth:10 height:10] autorelease];
[_scene setMaze:maze];
// Start director
[_director runWithScene: _scene];
return YES;
}
I'm using the last beta (0.99.5-beta2) with a 3GS that has 4.1 firmware, but I'm building with a 3.2 Base SDK for a 3.0 target. The target settings don't seem to have any effect on this issue by the way, so far I've never seen the FPS counter.