You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I currently have to do something like this to increment an interval when the animation duration reaches/passes the Actor's duration—so do something when the animation completes one loop:
On some other platforms we have the concept of AnimationInstance which tracks time for the animation and can report when the animation completes/loops (and has a callback for elapsed events that can trigger on the timeline). We could add something like that which you can use in your FlareController.
Some pseudo-ish code follows...
FlareControls could then return the animationInstance:
You could also use AnimationInstance directly in a FlareController:
classMyControllerextendsFlareController {
AnimationInstance someAnimation;
@overridevoidinitialize(FlutterActorArtboard artboard) {
// new artboard method to create an instance
someAnimation = artboard.getAnimationInstance("someAnimation");
}
@overridebooladvance(FlutterActorArtboard artboard, double elapsed) {
super.advance(artboard, elapsed);
// internally will invoke listeners
someAnimation.advance(elapsed);
// apply doesn't need time and mix as the instance holds these internally
someAnimation.apply(artboard);
}
}
Curious to hear what people would prefer/find more flexible/fits the platform best.
I currently have to do something like this to increment an interval when the animation duration reaches/passes the Actor's duration—so do something when the animation completes one loop:
It would be easier if one could use a controller that has an addStatusListener listening for an AnimationStatus of completed and isAnimating?
The text was updated successfully, but these errors were encountered: