加速计UIAcceleration,菜单menu,动作action
加速计
启动加速计事件并通过delegate去处理事件
self.isAccelerometerEnabled = YES;
-(void)accelerometer:(UIAccelerometer*)accelerometer didAccelerate:(UIAcceleration*)acceleration
{
}
菜单Menu:
CCMenuItemFont
CCMenuItemSprite
CCMenuItemToggle
CCMenuItemLabel
CCMenuItemImage
Action:
动作分瞬时动作和延时动作。
CCMoveTo
CCMoveTo *move = [CCMoveTo actionWithDuration:3 position:CGPointMake(100,200) ]; [myNode runAction:move];
CCRotateBy 和 重复动作:
CCRotateBy* rotateBy = [CCRotateBy actioonWithDuration:3 angle:360]; CCRepeatForever *repeat = [CCRepeatForever actionWithAction: rotateBy]; [myNode runAction:repeat];
流畅动作:
CCEaseAction
CCEaseBounceIn
CCEaseElasticIn
CCEaseExponentialIn
CCEaseIn
CCEaseSineIn
CCEaseInOut* ease = [CCEaseInOut actionWithAction:move rate:4]; [myNode runAction: ease];
CCTintTo
CCSequence* sequence = [CCSequence actions:tint1, tint2, tint3, nil];
[label runAction: sequence];
和类似于move,rotate等动作和repeatforever的动作结合,同样CCRepeatForever和CCSequence想结合一起使用。
这样就会使重复动作和动作序列结合,一遍按照序列放动作,一边不断重复动作。
瞬时动作,
CCCallFunc [CCCallFunc actionWithTarget:self selector:@selector(onCallFunc)];
CCCallFuncN [CCCallFunc actionWithTarget:self selector:@selector(onCallFuncN:)];
CCCallFuncND [CCCallFunc actionWithTarget:self selector:@selector(onCallFuncND:data:) data:(void)self];