Custom Easing and Tweaking Existing Easing Functions

Hi,

 

Johannes-lalala made a fantastic suggestion in another topic about creating your own Easing Functions.

( http://forums.coronalabs.com/topic/29539-best-approach-for-shaking-my-display-group/ )

My question is, is it possible to see the code behind the default Easing Functions?

I’d like to use something similar to the Elastic easing and would prefer to copy, understand and tweak the existing one, rather than try and replicate from scratch.

Cheers,

Jules.

Hi,

I’m sure if you Google around you’ll find plenty of code for easing libraries. The language might not be Lua but the math should be doable to understand.

as per thomas6, google for “penner easing lua” and you’ll find dozens of implementations, fe: https://github.com/EmmanuelOga/easing/blob/master/lib/easing.lua

though be aware that corona expects the parameters in a little different form than is typically given.

i wrote a tiny bit about it here if it helps (w a “framework” for playing with your own equations)

http://davebollinger.org/corona-quick-thought-a-custom-inoutback-easing-function/

http://davebollinger.org/corona-quick-thought-more-on-easing-functions/

Thanks, thomas6, and davebollinger.

I have managed to achieve the effect that I was after by running two concurrent transitions, one for x/y position and a separate one for x/y scale, using different easing functions.

But, my interest has been piqued and I will research further

Cheers,

Jules.

Hi,

I’m sure if you Google around you’ll find plenty of code for easing libraries. The language might not be Lua but the math should be doable to understand.

as per thomas6, google for “penner easing lua” and you’ll find dozens of implementations, fe: https://github.com/EmmanuelOga/easing/blob/master/lib/easing.lua

though be aware that corona expects the parameters in a little different form than is typically given.

i wrote a tiny bit about it here if it helps (w a “framework” for playing with your own equations)

http://davebollinger.org/corona-quick-thought-a-custom-inoutback-easing-function/

http://davebollinger.org/corona-quick-thought-more-on-easing-functions/

Thanks, thomas6, and davebollinger.

I have managed to achieve the effect that I was after by running two concurrent transitions, one for x/y position and a separate one for x/y scale, using different easing functions.

But, my interest has been piqued and I will research further

Cheers,

Jules.