-
Notifications
You must be signed in to change notification settings - Fork 459
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added custom loop point to FlxAnimation #2621
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very convenient. Would love to see this used.
I'm confused by the reverse behavior. It seems like a reverse animation similar to the one you describe would be: Am I correct? do others agree with my preference? |
I think loopPoint should be where does the animation start, like if the animation is reversed, the loopPoint should be at the end of the animation or something that would be equivalent |
That doesn't seem intuitive to me, since the animation's frames aren't decided that way. also if you add frames to an animation it would change the effective loopPoint. I think frame numbers should always refer to the absolute frame number |
I was mistaken, here. For some reason I forgot |
thanks! |
Thank you for the merge! To clarify, this is not an argument of I did it that way because I noticed the |
yeah this is too niche of a feature to add to such an already large function Maybe in 5.0.0 we can change loop, and flipX/Y to be enums. or add a addAdvanced() to prevent breaking games |
Yeah, in the future an addAdvanced function could take a parameter object to allow for much finer tuning of configuration. |
This simple change adds the ability to set a custom loop point on an FlxAnimation.
This allows you to conveniently perform behaviors such as having a "lead-in" to a looping animation.
For example, if you have a 5-frame animation, and you set
loopPoint
to 3, the frames you see will be:1-2-3-4-5~3-4-5~3-4-5~3-4-5~3-4-5