Table of Contents

Method CreateNinePatchSlice

Namespace
MonoGame.Aseprite
Assembly
MonoGame.Aseprite.dll

CreateNinePatchSlice(string, Rectangle, Rectangle, Vector2, Color)

Creates and adds a new NinePatchSlice element to this TextureRegion.

public NinePatchSlice CreateNinePatchSlice(string name, Rectangle bounds, Rectangle centerBounds, Vector2 origin, Color color)

Parameters

name string

The name to assign the NinePatchSlice 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 NinePatchSlice created by this method. This should be relative to the bounds of this TextureRegion.

centerBounds Rectangle

The center bounds to assign the NinePatchSlice created by this method. This should be relative to the bounds.

origin Vector2

The x- and y-coordinate origin point to assign the NinePatchSlice 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 NinePatchSlice created by this method.

Returns

NinePatchSlice

The NinePatchSlice created by this method.

Exceptions

InvalidOperationException

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