easing

I wonder if someone could give me a quick example of how to use the easing functions

easing.outExpo( t, tMax, start, delta )

I understand the standard easing use in transitions but not how to use the t, tMax, start, delta to adjust the easing motion. Thanks!

Kevin [import]uid: 96383 topic_id: 17830 reply_id: 317830[/import]

Where are you getting the syntax for easing.outExpo? If you look at the API page on easing.outExpo you will see that it is specified as a “transition” parameter for transition.to and transition.from. It’s not a method call like you show.
http://developer.anscamobile.com/reference/index/easingoutexpo-0

You will see an example of all the transitions in the SampleCode/Graphics/Easing_Example. [import]uid: 7559 topic_id: 17830 reply_id: 68124[/import]

This page has the forms, but I can’t figure out how to use ( t, tMax, start, delta ) to achieve the desired movements.

https://developer.anscamobile.com/code/more-easing

[import]uid: 96383 topic_id: 17830 reply_id: 68125[/import]

But the plain vanilla presentation of: easing.outExpo( t, tMax, start, delta ) shows up on this page -

http://developer.anscamobile.com/content/animation

but without an explanation that I can find of how to use easing.outExpo( t, tMax, start, delta ) I’m sure it’s probably plain as the nose on my face, but I seem to be stuck… [import]uid: 96383 topic_id: 17830 reply_id: 68126[/import]

That code is contributed by a user and not shipped with Corona. You should ask your question on that page to get your answer. You could also study the source code and try different values to see how the code works. [import]uid: 7559 topic_id: 17830 reply_id: 68128[/import]

Hey Tom, thanks for replying. I’m actually asking about an Ansca provided page, (http://developer.anscamobile.com/content/animation) which contains this copy talking about the eaising library - I’m just trying to find an example of how to implement ( t, tMax, start, delta ). Sure appreciate any help…

The easing library is a collection of interpolation functions used by the transition library:

easing.linear( t, tMax, start, delta )
easing.inQuad( t, tMax, start, delta )
easing.outQuad( t, tMax, start, delta )
easing.inOutQuad( t, tMax, start, delta )
easing.inExpo( t, tMax, start, delta )
easing.outExpo( t, tMax, start, delta )
easing.inOutExpo( t, tMax, start, delta )
[import]uid: 96383 topic_id: 17830 reply_id: 68131[/import]

Now I see where the confusion comes from. The easing library on the animation page describes how the easing functions work internally if you wanted to write your own easing transitions. The code page that you first referred to extends the easing library beyond the seven easing transitions listed above.

Your code would not call the easing methods directly, but use it with transition.to and transition.from as the “transition=” parameter. The transition method calls the easing function every frame time (with the t, tMax, start, and delta parameters) and the method returns the value based on the current elapsed time. All you do is supply the name of easing function to the transition.to/from method. You don’t need to worry about the parameters. [import]uid: 7559 topic_id: 17830 reply_id: 68132[/import]

Hey Tom, thanks. Yes, I completely understand how to use the standard linear easing functions, and I am actually interested in experimenting with creating easing on a curve. I am wondering if there is a written example of how to use the easing library to accomplish this. I have tried putting values in place of the ( t, tMax, start, delta ) but that is obviously not what I am supposed to do - doesn’t work:) Is there a example where an easing curve has been facilitated using ( t, tMax, start, delta ) that I might look at? [import]uid: 96383 topic_id: 17830 reply_id: 68172[/import]

@Tom
Can you provdide more details in how how to use custom easing functions

Suppose I have a transition
[lua]local myEasingFunction
transition.to(object,{time=2000,x = object.x + 200,transition = myEasingFunction})
myEasingFunction = function(t, tMax, start, delta)
–What must I return here
end[/lua]
What exactly must my easing function return? The distance to be covered in the next frame or the next 1000 ms or something like that? Can you be more specific?
[import]uid: 64174 topic_id: 17830 reply_id: 71834[/import]