Hi
I have 10 images a ball of same size. I need to show the ball animation. The ball animation should start image1 and should end with image10.
I want to show that the ball is travelled far from the throwing position. So, I need to show that the images at the end of animation are small.
For this I manually resized the images of the ball.
How can programmatically scale the images in to smaller size according to the position of the image?
Thank you.
views:
7answers:
1
A:
make a counter. each frame add one to the counter and update the scale of the sprite based off of that counter.
#define scale 5
-(void)foo
{
if(counter<100)
{
counter = counter + 1;
[ball animatewithframe:counter];
[ball setScale:(1/counter*scale)]; //this will get smaller and smaller as counter goes to 500
}
}
something like that.
Okiedoke
2010-07-19 01:48:19