23 lines
502 B
Haxe
Executable File
23 lines
502 B
Haxe
Executable File
package hw.animate;
|
|
|
|
import hw.animate.Animate;
|
|
import hw.animate.IAnimate;
|
|
import promhx.Promise;
|
|
|
|
class FadeAnimate extends Animate {
|
|
|
|
override public function start():Promise<IAnimate> {
|
|
object.alpha = 1.0;
|
|
return super.start();
|
|
}
|
|
|
|
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;
|
|
}
|
|
}
|