Adding features to the Transition API

I’m making great progress on my animation project, but find that I keep reaching for a few additional properties that I’ve grown used to with TweenMax. While I think the Transitions API should mirror most of these, (http://www.greensock.com/tweenmax/) my top 5 - in order of precedence - are described below and translated from the AS3 syntax used by greensock as an example.

1.) startAt:Table
This allows you to define the starting values for each property. Typically, transition uses the current value (whatever it happens to be at the time the transition begins) as the start value, but startAt allows you to override that behavior. Simply pass a table in with whatever properties you’d like to set just before the tween begins.

For example, if “image.x” is currently 100, and you’d like to transition it from 0 to 500, do
[blockcode]transition.to (image, {time=1, x=500, startAt={x:0})[/blockcode]

2.) repeat : number Number of times that the transition should repeat. To repeat indefinitely, use -1 and repeatDelay : number Amount of time in milliseconds between repeats.
[blockcode]transition.to (blinkingimage, {time=100, alpha=0, repeat=-1, repeatDelay=1500)[/blockcode]
3.) yoyo : boolean Works in conjunction with the repeat property, determining the behavior of each cycle. When yoyo is true, the transition will go back and forth, appearing to reverse every other cycle. So if repeat is 2 and yoyo is false, it will look like: start - 1 - 2 - 3 - 1 - 2 - 3 - 1 - 2 - 3 - end. But if repeat is 2 and yoyo is true, it will look like: start - 1 - 2 - 3 - 3 - 2 - 1 - 1 - 2 - 3 - end.

4.) onInit : Function and a optional onInitParams : Table An Array of parameters to pass the onInit function.

Similar to the existing onComplete , this is a function that should be called just before the transition initalizes (renders for the first time). Since onInit runs before the start/end values are recorded internally, it is a good place to run code that affects the target’s initial position or other transition-related properties. onStart, by contrast, runs AFTER the transition inits and the start/end values are recorded internally. onStart is called every time the transition begins which can happen more than once if the transition is restarted multiple times.

5.) onStart : Function and an optional onStartParams : Table An Array of parameters to pass the onStart function.

This is a function that should be called when the transition begins (when its currentTime is at 0 and changes to some other value which can happen more than once if the transition is restarted multiple times).

I realize you don’t “need” any more work between now and getting the SDK released, but wanted to share the feedback and insights from my current efforts.

-Andy [import]uid: 5339 topic_id: 1965 reply_id: 301965[/import]

Have you reviewed the documentation for transition.to() and transition.from() ?
https://developer.anscamobile.com/content/animation#transition.from_target_params_

-Tom [import]uid: 7559 topic_id: 1965 reply_id: 6113[/import]

Don’t forget

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

me.
[import]uid: 24 topic_id: 1965 reply_id: 6135[/import]

you seem to have added a lot of stuff from tweenmax. is there also some timelinemax functionality in corona or is this planned in future? [import]uid: 4426 topic_id: 1965 reply_id: 6449[/import]

Little bump to get back under attention. Is there any functioanlity like timelinemax in corona? That would complement the tweening functions so nicely and make corona extremely powerfull at creating all kinds of educational timeline based stuff.

Kind regards,

Bart Libert [import]uid: 4426 topic_id: 1965 reply_id: 8544[/import]

Diving into corona myself and the first thing I miss any time I leave actionscript is tweenmax and timelinemax. I am starting by porting over some code I had started in actionscript and I was using timelinemax for tweening and to be able to save the tween and play it back at what ever speed I wanted. I’d also love to see the animation library mirror the greensock tools as much as possible.

Jack ( the greensock author ) is a great guy, maybe you guys should see if he has any interest in lua. Who wants to chip in and pay him to port it? :slight_smile: [import]uid: 62031 topic_id: 1965 reply_id: 42157[/import]