I want to give a stretch animation to a sprite .
This is code i tried
id scaleUpAction = [CCEaseInOut actionWithAction:[CCScaleTo actionWithDuration:4.0 scaleX:1.0 scaleY:10.0] rate:2.0];
But i want to keep the top position and then animate like wave effect from top to bottom.
Can any suggest me method to do this ?
thanks in advance
Cannot understand what do you mean under “waves”, but about first path of your question – to keep top position, you should change anchor point of your sprite. All transformations are done relatieve to the node’s (sprite’s in your case) anchor point. So, if you want to fix left-top corner of your sprite, just set it’s
anchorPointproperty to (0.f, 1.f). Anchor point (1.f, 1.f) will fix right-top corner of your sprite.