Class SpriteFromSheet
A sprite provider from a SpriteSheet
[DataContract("SpriteFromSheet")]
[Display("Sprite Group", null)]
public class SpriteFromSheet : IAnimatableSpriteProvider, ISpriteProvider
- Inheritance
-
SpriteFromSheet
- Implements
Properties
CurrentFrame
Gets or sets the current frame of the animation.
[DataMember]
[Display("Default Frame", null)]
public int CurrentFrame { get; set; }
Property Value
Sheet
Gets or sets the Sheet of the provider.
[DataMember]
public SpriteSheet Sheet { get; set; }
Property Value
SpritesCount
Gets the number of sprites available in the provider.
public int SpritesCount { get; }
Property Value
Methods
Create(SpriteSheet, string)
Creates a new instance of SpriteFromSheet with the specified SpriteSheet.
CurrentFrame is initialized according to the specified spriteName
.
public static SpriteFromSheet Create(SpriteSheet sheet, string spriteName)
Parameters
sheet
SpriteSheetspriteName
stringThe name of the sprite.
Returns
Remarks
If two sprites have the provided name then the first sprite found is used.
Exceptions
- ArgumentNullException
sheet
- KeyNotFoundException
No sprite in the sheet has the given name.
GetSprite()
Get a sprite from the provider.
public Sprite GetSprite()