I haven’t been able to find much of anything about creating custom Easing using Cocos-2dx, but I did come across the EaseBezierAction class which has a setBezierParamer method that takes 4 floats to create a bezier curve (from my understanding).
This sounds like what I can use to create a custom Ease, but it seems to have an issue, possibly a bug? When I apply the ease to an action and run it, it acts like only 80% of the curve is being used. For example if I have a curve that extends above 1.0 to say 1.5 and back to 1.0 at the very end, the animation stops around the 1.5 value and never returns to 1.0.
Here is some example code I’m using:
auto scaleAction = ScaleTo::create(time, 1.0f);
EaseBezierAction* customEase = EaseBezierAction::create(scaleAction);
customEase->setBezierParamer(.55f, -0.58f, .45f, 1.47f);
//auto ease_test = EaseBackOut::create(scaleAction);
node->runAction(customEase);
node->runAction(FadeIn::create(time));
With this example code the bezier curve is a sin wave that extends below 0 at the start and above 1 towards the end. It’s interesting because the scale that goes below at the start works fine, its just the scale above 1 towards the end where the animation leaves the scale above 1 and doesn’t return to 1.0…
Has anyone else used this class or seen this issue? Really hoping someone can help me get custom eases figured out.
PS- I’ve been using http://cubic-bezier.com to generate custom bezier curves.
