forked from LeenkxTeam/Leenkx_Examples
update
This commit is contained in:
33
ease/Sources/lnx/TweenTest.hx
Normal file
33
ease/Sources/lnx/TweenTest.hx
Normal file
@ -0,0 +1,33 @@
|
||||
package lnx;
|
||||
|
||||
import iron.system.Tween;
|
||||
#if lnx_debug
|
||||
import leenkx.trait.internal.DebugDraw;
|
||||
#end
|
||||
|
||||
class TweenTest extends iron.Trait {
|
||||
|
||||
@prop var ease : Int = 0;
|
||||
|
||||
public function new() {
|
||||
super();
|
||||
notifyOnInit(() -> {
|
||||
#if lnx_debug
|
||||
//DebugDraw.notifyOnRender( draw -> draw.bounds( object.transform) );
|
||||
#end
|
||||
doTween(10);
|
||||
});
|
||||
}
|
||||
|
||||
function doTween( v : Float ) {
|
||||
Tween.to({
|
||||
target: object.transform.loc,
|
||||
props: { z: v },
|
||||
delay: 0.5,
|
||||
duration: 2.0,
|
||||
ease: ease,
|
||||
tick: object.transform.buildMatrix,
|
||||
done: () -> doTween(-v)
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user