Hello all,
I want to implement a bounce out easing function in my application.
Something similar to elastic out.
Like as in the following link http://www.powerping.be/js/jstween/moveSquare.html
I want to implement something like that.
Hello all,
I want to implement a bounce out easing function in my application.
Something similar to elastic out.
Like as in the following link http://www.powerping.be/js/jstween/moveSquare.html
I want to implement something like that.
OK, so I'm guessing you're trying to animate a UIView (or similar) using Core Animation.
You'll want to look at using CABasicAnimation
, which provides a mechanism for animating properties (like position), as well as setting a timing function (or "easing function") via the timingFunction
property.
The timingFunction
property takes an instance of CAMediaTimingFunction
, which has a number of predefined timing functions like kCAMediaTimingFunctionLinear
, kCAMediaTimingFunctionEaseIn
, kCAMediaTimingFunctionEaseOut
& kCAMediaTimingFunctionEaseInEaseOut
. If the predefined functions aren't enough, you can define your own which is described in the Animation Types and Timing Programming Guide (in particular, the section on Animation Pacing).
The next step up from CABasicAnimation
is CAKeyframeAnimation
, which you may need to do if you want to animate your view along a multi-segment path, with a separate timing functions per path segment. There are some examples on how that works under Keyframe Timing and Pacing Extensions.
Hope that helps!
You might also find what you want in the Cocos2D Iphone framework, that's what I've been suggested.
Does anyone know of another way to directly do these kind of tweening + easing and use it in OpenGL ES though?