Signature of easing functions

I would like to use some of Corona’s easing functions directly, however, I cannot find their signatures in the docs. Does anyone know how to invoke them manually?

I tried using the docs of Robert Penner’s Easing Functions, but I got confusing results, so I assume Corona did some changes there?

i’m not aware of any “official” docs (and no idea why they left this out), but…

  1. the interpolation parameter, often as “t” (sometimes aka “time”, particularly in animation systems)

  2. the maximum value of “t” above

  3. the start value of the interpolation

  4. the delta (aka end-start) value of the interpolation

another way of looking at ii:  if you’re comfortable with how a typical linear interpolation function would be (traditionally) worded as:  lerp(a,b,t)   then in easing it’s equivalent would be:  easing.linear(t,1,a,(b-a))

As you already pointed out Corona uses Robert Penner’s easing functions, but they switched around the parameters.

Original:

-- t = time should go from 0 to duration -- b = begin value of the property being ease. -- c = change ending value of the property - beginning value of the property -- d = duration the duration of the whole easing process easingFuntion(t, b, c, d)

Corona:

-- t = time should go from 0 to duration -- b = begin value of the property being ease. -- c = change ending value of the property - beginning value of the property -- d = duration the duration of the whole easing process easingFuntion(t, d, b, c)

So they just switched the position of the duration from the last to the second position.

Hope that helps :slight_smile:

Thanks, guys! That’s exactly what I needed. Works like a charm! :slight_smile:

i’m not aware of any “official” docs (and no idea why they left this out), but…

  1. the interpolation parameter, often as “t” (sometimes aka “time”, particularly in animation systems)

  2. the maximum value of “t” above

  3. the start value of the interpolation

  4. the delta (aka end-start) value of the interpolation

another way of looking at ii:  if you’re comfortable with how a typical linear interpolation function would be (traditionally) worded as:  lerp(a,b,t)   then in easing it’s equivalent would be:  easing.linear(t,1,a,(b-a))

As you already pointed out Corona uses Robert Penner’s easing functions, but they switched around the parameters.

Original:

-- t = time should go from 0 to duration -- b = begin value of the property being ease. -- c = change ending value of the property - beginning value of the property -- d = duration the duration of the whole easing process easingFuntion(t, b, c, d)

Corona:

-- t = time should go from 0 to duration -- b = begin value of the property being ease. -- c = change ending value of the property - beginning value of the property -- d = duration the duration of the whole easing process easingFuntion(t, d, b, c)

So they just switched the position of the duration from the last to the second position.

Hope that helps :slight_smile:

Thanks, guys! That’s exactly what I needed. Works like a charm! :slight_smile: