cocos2d iphone - CCEaseIn etc inside CCSequence -


how use easing inside ccsequence?

related using cceaseout ccsequence?

here example. brings mapnode left border, example when lhs menu popped out. move duration , acceleration computed function of expected displacement :

- (void)setleftclamp:(float)leftclamp {      _leftclamp = leftclamp;      cgpoint currentposition = self.mapnode.position;     if (currentposition.x > self.maxx) {         // ease right in position         cgpoint delta         = ccp (self.maxx - currentposition.x, 0);         id      move          = [ccmoveby actionwithduration:[self moveduration:delta] position:delta];         id      ease          = [cceasein actionwithaction:move rate:[self moveacceleration:delta]];         id      delay         = [ccdelaytime actionwithduration:.1f];         id      easeandcenter = [ccsequence actions:ease, delay, [cccallfunc actionwithtarget:self selector:@selector(onmovecomplete)], nil];         [self.mapnode runaction:easeandcenter];          targetmaplocation_ = ccpadd(self.mapnode.position, delta);         mapdisplacement_   = delta;         ismapmoving_       = yes;      }  } 

Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -