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
regionIndex
intThe index of the source TextureRegion in the TextureAtlas of the SpriteSheet.
duration
TimeSpanThe 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
stringThe name of the source TextureRegion in the TextureAtlas of the SpriteSheet.
duration
TimeSpanThe 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.