Hi
when I were using c*sdk for animation I do :
local tr
tr= transion.to(obj,{x=2,y=2,alpha=0,transtion=easing.inExpo,onComplete= some function})
later to remove it from the memory :
transition.cancel(tr)
Even if you are not familier with c*sdk,
I think you know what I mean.
I tried to find Gtween use in gideros reference manual,I did not.
A.Can you give me an exaple how to translate the above code,or a link to an example,I searched the foroums ,I could not find exatly what I were looking for.
B.and should I require(`Gtween`) and where can I find it
Thanks
www.zoolax.com
Comments
the link for GTween is https://github.com/gideros/GTween
Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
Cool Vizify Profile at https://www.vizify.com/oz-apps
I liked it back then,
Is there any way to call a function on the completion of the animation or before it begins?
I have already test it in Gideros,I am more concern how can I call another function after
it is done using movie clip or Gtween.
The events are "complete", "init" and "change" you will need to addEventListener on the Tween object that you create with new.
Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
Cool Vizify Profile at https://www.vizify.com/oz-apps
http://appcodingeasy.com/Gideros-Mobile/Gideros-GTween-with-easing
Likes: paulocarrasco
GTween.new is basically identical to Corona's transition.to. If you want to do transition.from, there is a swapValues flag. There is no explicit transition.cancel function. Instead you pause the GTween and it will automatically be garbage collected when its target is collected.
There doesn't seem to be any official documentation so I just looked at the gtween.lua source code -- which is not very long.
https://github.com/gideros/gideros
https://www.youtube.com/c/JohnBlackburn1975
I found some simple samples,I have no problem figuring out the easing function and other things.
I wanted to figure out the call back functions for Gtween and movieclip ,and how they work?
Just a simple line of code would do:)
Thanks
Here's an example:
So basically yes