从网上收集一些有用的方法,总结一下以便以后复习查找。
内容简要:
1、改变游戏速度
4、在cocos2d中设置横屏
7、粒子系统用法
10、禁止自动锁屏
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//1、改变游戏速度
[[CCScheduler sharedScheduler] setTimeScale:2.0f];//设置为正常的2倍
//2、获取当前屏幕宽高
CGSize size =[[CCDirector sharedDirector]winSize];
CCLayerColor *layer =[CCLayerColor layerWithColor:ccc4(0, 0, 0, 127)];
[self addChild:layer];
return ( UIInterfaceOrientationIs
//5、在cocos2d中设置竖屏
return ( UIInterfaceOrientationIs
//6、在cocos2d中设置高清模式
[director enableRetinaDisplay:YES]
//7、粒子系统用法
//添加一个粒子特效
CCParticleSystem *tempSystem = [ARCH_OPTIMAL_PARTICLE_SYSTEM particleWithFile:@"himi.plist"];
//定义位置类型
tempSystem.positionType=kCCPositionTypeRelative;//相对模式
tempSystem.position=ccp(100,100);
[self addChild:tempSystem];
//8、进度条
CCProgressTimer *ct=[CCProgressTimer progressWithFile:@"icon.png"];
ct.position=ccp( size.width /2 , size.height/2);
[self addChild:ct z:0 tag:90];
ct.percentage = 0; //当前进度
ct.type=kCCProgressTimerTypeHori
//9、设置为2d
[[CCDirector sharedDirector] setProjection:kCCDirectorProjection2D];
//10、禁止自动锁屏