-
Hi, |
Beta Was this translation helpful? Give feedback.
Answered by
Sebosek
Apr 8, 2023
Replies: 1 comment
-
If someone would have a similar requirement, here is how you could do it using the Animation API. private void AnimationStart_OnClicked(object? sender, EventArgs e)
{
const string NAME = "lottie";
// Requested length of animation
var requested = TimeSpan.FromSeconds(2).TotalMilliseconds;
// To manually move the progress of animation, compute multiplication
var multiplication = Duration.TotalMilliseconds / requested;
// Create an animation to make a progress in Lottie animation (IsAnimationEnabled has to set to false)
var animation = new Animation(v => Progress = TimeSpan.FromMilliseconds(v * multiplication), 0, requested);
// Run the animation
animation.Commit(this, NAME, 25, 3000, Easing.Linear, (_, _) => Progress = TimeSpan.Zero, () => false);
} |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Sebosek
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If someone would have a similar requirement, here is how you could do it using the Animation API.