MonoGame.Extended icon indicating copy to clipboard operation
MonoGame.Extended copied to clipboard

FrameDuration for each frame when using SpriteSheetAnimationFactory.Add()

Open Dante3085 opened this issue 4 years ago • 3 comments

I followed the MonoGame.Extended tutorial for creating animations and couldn't find a way to set the frameDuration for an individual frame. It seems like there is just one frameDuration for the whole animation like in the following piece of code...

animFactory.Add("idle", new SpriteSheetAnimationData(new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }, frameDuration: .1f, isLooping: true));

I created this animation in Aseprite. The first frame has a slow startup of 300ms and all other frames have 100ms delay. It seems like this is not possible with the animation tools MonoGame.Extended provides. I understand if it's too much of a change to the animation system, but it would improve the expressiveness of animations.

Dante3085 avatar Aug 26 '20 17:08 Dante3085

@Dante3085 Yes, I agree, I think it would be a good idea to have individual frame durations. I guess it wasn't an expected thing before. Do you have the animation file for Aseprite I could use for piloting this?

lithiumtoast avatar Aug 31 '20 01:08 lithiumtoast

@lithiumtoast Thanks for taking the time! Yes, I uploaded the exported spritesheet and the original .aseprite file to wetransfer. You can download them over this link.

Credit for the original animation goes to How to start making pixel art though. I just followed the tutorial and re-created it slightly differently.

Dante3085 avatar Aug 31 '20 13:08 Dante3085