Search code examples
iphonecore-animationcocos2d-iphone

How do you do an equivalent scaling call in cocos2d as this Core Animation scale?


I'm looking for something that does a similar call, but using cocos2d... the idea is to enlarge the sprite and then fade it out... Here's is a similar call in core animation:

[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:ANIM_NORMAL];
someView.alpha = 0.0;
someView.transform = CGAffineTransformMakeScale (3.0, 3.0);
[UIView commitAnimations];

Solution

  • id enlargeAndFade = [Sequence actions: [ScaleTo...], [FadeOut....], nil];
    
    [sprite runAction:enlargeAndFade];
    

    have a look here as well there will be plenty about so called 'actions': http://www.cocos2d-iphone.org/forum/