Method CreateSprite
CreateSprite(string, int)
Creates a new Sprite from the TextureRegion at the specified index in the TextureAtlas of this SpriteSheet.
public Sprite CreateSprite(string spriteName, int regionIndex)Parameters
- spriteNamestring
- The name to assign the Sprite that is created. 
- regionIndexint
- The index of the TextureRegion element in the TextureAtlas assign the Sprite that is created. 
Returns
Exceptions
- ArgumentOutOfRangeException
- Thrown if the specified index is less than zero or is greater than or equal to the total number of TextureRegion elements in the TextureAtlas. 
CreateSprite(int)
Creates a new Sprite from the TextureRegion at the specified index in the TextureAtlas of this SpriteSheet.
public Sprite CreateSprite(int regionIndex)Parameters
- regionIndexint
- The index of the TextureRegion element to assign the Sprite that is created. 
Returns
Exceptions
- ArgumentOutOfRangeException
- Thrown if the specified index is less than zero or is greater than or equal to the total number of TextureRegion elements in the TextureAtlas. 
CreateSprite(string, string)
Creates a new Sprite from the TextureRegion at the specified index in the TextureAtlas of this SpriteSheet.
public Sprite CreateSprite(string spriteName, string regionName)Parameters
- spriteNamestring
- The name to assign the Sprite that is created. 
- regionNamestring
- The name of the TextureRegion element in the TextureAtlas assign the Sprite that is created. 
Returns
Exceptions
- KeyNotFoundException
- Thrown if the TextureAtlas does not contain a TextureRegion with the name specified. 
CreateSprite(string)
Creates a new Sprite from the TextureRegion at the specified index in the TextureAtlas of this SpriteSheet.
public Sprite CreateSprite(string regionName)Parameters
- regionNamestring
- The name of the TextureRegion element in the TextureAtlas assign the Sprite that is created. 
Returns
Exceptions
- KeyNotFoundException
- Thrown if the TextureAtlas does not contain a TextureRegion with the name specified.