Method CreateRegion
CreateRegion(string, int, int, int, int)
Creates a new TextureRegion and adds it to this TextureAtlas.
public TextureRegion CreateRegion(string name, int x, int y, int width, int height)
Parameters
namestringThe name to assign the TextureRegion that is created. The name must be unique across all
TextureRegion in this TextureAtlas.xintThe x-coordinate location of the upper-left corner of the TextureRegion within the source image of this TextureAtlas.
yintThe y-coordinate location of the upper-left corner of the TextureRegion within the source image of this TextureAtlas.
widthintThe width, in pixels, of the TextureRegion.
heightintThe height, in pixels, of the TextureRegion.
Returns
- TextureRegion
The TextureRegion created by this method.
Exceptions
- InvalidOperationException
Thrown if this TextureAtlas already contains a TextureRegion element with the specified name.
CreateRegion(string, Point, Point)
Creates a new TextureRegion and adds it to this TextureAtlas.
public TextureRegion CreateRegion(string name, Point location, Point size)
Parameters
namestringThe name to assign the TextureRegion that is created. The name must be unique across all
TextureRegion in this TextureAtlas.locationPointThe x- and y-coordinate location of the upper-left corner of the TextureRegion within the source image of this TextureAtlas.
sizePointThe width and height extents, in pixels, of the TextureRegion.
Returns
- TextureRegion
The TextureRegion created by this method.
Exceptions
- InvalidOperationException
Thrown if this TextureAtlas already contains a TextureRegion element with the specified name.
CreateRegion(string, Rectangle)
Creates a new TextureRegion and adds it to this TextureAtlas.
public TextureRegion CreateRegion(string name, Rectangle bounds)
Parameters
namestringThe name to assign the TextureRegion that is created. The name must be unique across all
TextureRegion in this TextureAtlas.boundsRectangleThe rectangular bounds of the TextureRegion within the source image of this TextureAtlas.
Returns
- TextureRegion
The TextureRegion created by this method.
Exceptions
- InvalidOperationException
Thrown if this TextureAtlas already contains a TextureRegion element with the specified name.