Table of Contents

Method CreateRegion

Namespace
MonoGame.Aseprite
Assembly
MonoGame.Aseprite.dll

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 string

The name to assign the TextureRegion that is created. The name must be unique across all
TextureRegion in this TextureAtlas.

x int

The x-coordinate location of the upper-left corner of the TextureRegion within the source image of this TextureAtlas.

y int

The y-coordinate location of the upper-left corner of the TextureRegion within the source image of this TextureAtlas.

width int

The width, in pixels, of the TextureRegion.

height int

The 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 string

The name to assign the TextureRegion that is created. The name must be unique across all
TextureRegion in this TextureAtlas.

location Point

The x- and y-coordinate location of the upper-left corner of the TextureRegion within the source image of this TextureAtlas.

size Point

The 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 string

The name to assign the TextureRegion that is created. The name must be unique across all
TextureRegion in this TextureAtlas.

bounds Rectangle

The 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.