Table of Contents

Method AddFrame

Namespace
MonoGame.Aseprite
Assembly
MonoGame.Aseprite.dll

AddFrame(int, TimeSpan)

Adds a new frame of animation to the AnimationTag using the TextureRegion located at the specified index in the TextureAtlas of the SpriteSheet and with the specified duration.

public AnimationTagBuilder AddFrame(int regionIndex, TimeSpan duration)

Parameters

regionIndex int

The index of the source TextureRegion in the TextureAtlas of the SpriteSheet.

duration TimeSpan

The duration of the frame of animation.

Returns

AnimationTagBuilder

This instance of the AnimationTagBuilder class.

Exceptions

ArgumentOutOfRangeException

Throw if the specified index is less than zero or is greater than or equal to the total number of regions in the TextureAtlas.

AddFrame(string, TimeSpan)

Adds a new frame of animation to the AnimationTag using the TextureRegion with the specified name in the TextureAtlas of the SpriteSheet and with the specified duration.

public AnimationTagBuilder AddFrame(string regionName, TimeSpan duration)

Parameters

regionName string

The name of the source TextureRegion in the TextureAtlas of the SpriteSheet.

duration TimeSpan

The duration of the frame of animation.

Returns

AnimationTagBuilder

This instance of the AnimationTagBuilder class.

Exceptions

KeyNotFoundException

Thrown if the TextureAtlas of the SpriteSheet does not contain a TextureRegion with the specified name.