cocos2D捕鱼达人源代码初学者详解3AppDelegate - 德化论坛
关键信息
- 作者
- nydx4359
- 发布时间
- 2015-12-03
AppDelegate.m 代码--------------------------------------------------------------------------------------------------------------------------------------...

AppDelegate.m 代码------------------------------------------------------------------------------------------------------------------------------------------------ - (void) removeStartupFlicker 代码------------------------------------------------------------------------------------------------------------------------------------------------ //removeStartupFlicker这个方法是专门用来去除闪烁的,只要打开注释,把
//CCSprite *sprite = [CCSprite spriteWithFile:@"Default.png"];
//替换成自己定义的Default名字就可以了。这样我们可以在程序开始显示Default这个图片,以实现Default的淡出效果,以及与logo的完美切换。
代码------------------------------------------------------------------------------------------------------------------------------------------------ #if GAME_AUTOROTATION == kGameAutorotationUIViewController 代码------------------------------------------------------------------------------------------------------------------------------------------------ //Cocos2D横竖屏设置
// 项目设计的时候首先决定有无需求做自动旋转,没有的话就用 kGameAutoroationNone
// 有的话再决定从 kGameAutorotationUIViewController 和 kGameAutorotationCCDirector 里面选一个。
// 后面二者的区别:
// CCDirector 是那种直来直往的,屏幕一翻转它会一步到位将画面翻转过来。
// UIViewController 则不一样,旋转的时候他会有个过渡的旋转效果,个人感觉比 CCDirector 那种的体验要好。
代码------------------------------------------------------------------------------------------------------------------------------------------------ window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 代码------------------------------------------------------------------------------------------------------------------------------------------------ // UIScreen类代表了屏幕,通过这个类我们可以获取一些想要的东东。
// CGrect screenBounds = [ [UIScreen mainScreen]bounds];//返回的是带有状态栏的Rect
// CGRect viewBounds = [ [UIScreen mainScreen]applicationFrame];//不包含状态栏的Rect
// screenBounds 与 viewBounds 均??相对于设备屏幕来说的
// 所以 screenBounds.origin.x== 0.0 ; screenBounds.oringin.y = 0.0;
// screenBounds.size.width == 320; screenBounds.size.height == 480(或者其他分辨率有所差异)
// 所以 screenBounds.origin.x== 0.0 ; screenBounds.oringin.y = 20.0;(因为状态栏的高度是20像素) screenBounds.size.width == 320; screenBounds.size.height == 480
// 取得StatusBar的位置和大小
// [self.view addSubview:theToolbar];
代码------------------------------------------------------------------------------------------------------------------------------------------------ if( ! [CCDirector setDirectorType:kCCDirectorTypeDisplayLink] )