Method AddFrame
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
regionIndexintThe index of the source TextureRegion in the TextureAtlas of the SpriteSheet.
durationTimeSpanThe 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
regionNamestringThe name of the source TextureRegion in the TextureAtlas of the SpriteSheet.
durationTimeSpanThe 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.