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
name
stringThe name to assign the TextureRegion that is created. The name must be unique across all
TextureRegion in this TextureAtlas.x
intThe x-coordinate location of the upper-left corner of the TextureRegion within the source image of this TextureAtlas.
y
intThe y-coordinate location of the upper-left corner of the TextureRegion within the source image of this TextureAtlas.
width
intThe width, in pixels, of the TextureRegion.
height
intThe 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
name
stringThe name to assign the TextureRegion that is created. The name must be unique across all
TextureRegion in this TextureAtlas.location
PointThe x- and y-coordinate location of the upper-left corner of the TextureRegion within the source image of this TextureAtlas.
size
PointThe 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
name
stringThe name to assign the TextureRegion that is created. The name must be unique across all
TextureRegion in this TextureAtlas.bounds
RectangleThe 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.