HI,
I have 10 images 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?
How can programmatically scale the images in to smaller size ?
(2 posts) (2 voices)-
Posted 1 year ago #
-
Every CCSprite (and every CCNode) has a scaleX, scaleY, and scale(which scales both X and Y) property. You can adjust those properties from 0 to 1 (1 being 100% normal size) or even over 1 to programmatically scale the images. Now scaling the images according to position requires a math formula completely up to you. It really depends on how much you want to scale the ball as it moves how much.
Source: Cocos2D documentation for Scaling:
http://www.cocos2d-iphone.org/api-ref/latest-stable/interface_c_c_node.html#a9c00de8556f267b63055ebd9e55f2415Posted 1 year ago #
Reply
You must log in to post.