[animate] update
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user