Table of Contents

Method CreateSlice

Namespace
MonoGame.Aseprite
Assembly
MonoGame.Aseprite.dll

CreateSlice(string, Rectangle, Vector2, Color)

Creates and adds a new Slice element to this TextureRegion.

public Slice CreateSlice(string name, Rectangle bounds, Vector2 origin, Color color)

Parameters

name string

The name to assign the Slice that is created by this method. The name must be unique across all Slice elements in this TextureRegion.

bounds Rectangle

The bounds to assign the Slice created by this method. This should be relative to the bounds of this TextureRegion.

origin Vector2

The x- and y-coordinate origin point to assign the Slice created by this method. This should be relative to the upper-left corner of the bounds of this TextureRegion.

color Color

A Microsoft.Xna.Framework.Color value to assign the Slice created by this method.

Returns

Slice

The Slice created by this method.

Exceptions

InvalidOperationException

Thrown if this TextureRegion already contains a Slice with the specified name.