How to zoom animation after pan cocos 2d iphone

75 views Asked by At

I want to show zoom animation after pan.

   - (void) didLoadFromCCB
   {

       self.anchorPoint = ccp( 0.9, 0.9 );
       self.scale = 1;

   }


   - (void) update:(ccTime)delta
   {


    float posX = self.position.x;
    float posY = self.position.y;
    float posNewX = posX - 100*delta;

    if (posX > -1024) {
      self.position = ccp(posNewX, posY);
    }else if (posX  < -1024) {

    id action2=[CCScaleTo actionWithDuration:4.5 scale:1.20];

    CCSequence *scaleSeq = [CCSequence actions:action2, nil];

    [self runAction:scaleSeq];

    }


 }

Panning is working, but zoom animation doesnt work.

1

There are 1 answers

0
Gulzaman On

animaiton.scale--; write it in your delta function it will decrease the the size of animation each time..if you want to increase use Scale++.