Skip to content

Commit

Permalink
Merge pull request #595 from Shallowmallow/slideToRight
Browse files Browse the repository at this point in the history
setting opacity SlideToRight
  • Loading branch information
ianharrigan authored Mar 24, 2024
2 parents 0bc5db6 + 675d1f0 commit f57a7d9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions haxe/ui/animation/AnimationTools.hx
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ class AnimationTools {
}

public static function slideToRight(c:Component, delayMs:Int = 0, onComplete:Void->Void = null, duration:Float = .2, easing:String = "linear") {
c.opacity = 0;
if (!c.isReady) {
c.registerEvent(UIEvent.READY, function(_) {
slideToRight(c, delayMs, onComplete, duration, easing);
Expand All @@ -235,9 +236,11 @@ class AnimationTools {
builder.setPosition(100, "left", Std.int(originX), true);
if (delayMs <= 0) {
builder.play();
c.opacity = 1;
} else {
haxe.ui.util.Timer.delay(function() {
builder.play();
c.opacity = 1;
}, delayMs);
}
}
Expand Down

0 comments on commit f57a7d9

Please sign in to comment.