[animate] update

This commit is contained in:
2020-03-24 23:37:08 +03:00
parent 279baa1113
commit fe60e78b74
10 changed files with 73 additions and 54 deletions

View File

@@ -2,19 +2,21 @@ package hw.animate;
import hw.animate.Animate;
import hw.animate.IAnimate;
import promhx.Promise;
class FadeAnimate extends Animate {
override public function start(callback:IAnimate -> Void, custom:Bool = false):Void {
override public function start():Promise<IAnimate> {
object.alpha = 1.0;
super.start(callback, custom);
return super.start();
}
override private function update(time:Float):Void {
super.update(time);
override public function update(time:Float):Bool {
var result = super.update(time);
object.alpha = 1 - (progress * 1.0);
if (progress >= 1) {
object.alpha = 0.0;
}
return result;
}
}