[Poll] Handling Loop Count #60
Replies: 2 comments 1 reply
-
Adding functional info to the tag seems to be a leaky abstraction that should be handled in code instead, IMO. I have in my project (using an older version of the library, though) a custom function that modifies the sprite OnAnimationLoop Action to stop it after playing once when I need it to. I don't have a version that loops an arbitrary number of times, but maybe a convenience function like |
Beta Was this translation helpful? Give feedback.
-
Closing this poll/discussion. |
Beta Was this translation helpful? Give feedback.
-
Hi everyone, I'm currently working on the ability to process Aseprite tags with a set loop count. This is related to issue #43
Description
Currently, within Aseprite, there is no option to specify if a Tag should loop and/or the total number of times it loops. It's assumed that all Tags created in Aseprite are looping animations. However, there are use-cases for having an animation not loop, or only loop a set number of times. For instance, a door opening or closing animation.
Looking through the Aseprite repository, I came across the following tracking issue aseprite/aseprite#1989 to support setting loop count. This however is for the Aseprite 1.3 release, so I have no definitive timeline for when this is officially supported.
However, I can implement something similar now as a middle ground in
MonoGame.Aseprite
.How It Would Be Implemented
The only way this could be implemented for use in
MonoGame.Aserpite
is through the name of a Tag. The idea at this time would be for users to name their tags with(x#)
where#
is the total number of times that tag should loop. For example, if you had a door open animation that should never loop, you would name it something likedoor_open (x0)
. If you wanted a Tag to use the default behavior of infinate looping, you would just exclude the loop count marker (e.g.door_open
).Poll Question
My question for this poll is, considering that you would need to add the
(x#)
to the end of a Tag to mark the loop count for that Tag, how would you like to see this handled by the processor when creating theAnimationTag
for aSpriteSheet
? Would you want the(x#)
removed from the Tag name or keep it as part of the tag name.Examples
The following examples assume an Aseprite file with a Tag defined named
door_open (x0)
to specify that the Tag does not loop.If Removing The Loop Count Marker
If NOT Removing The Loop Count Marker
3 votes ·
Beta Was this translation helpful? Give feedback.
All reactions