Table of Contents

Method GetSlice

Namespace
MonoGame.Aseprite
Assembly
MonoGame.Aseprite.dll

GetSlice(string)

Returns the Slice element with the specified name from this TextureRegion.

public Slice GetSlice(string name)

Parameters

name string

The name of the Slice element to locate.

Returns

Slice

The Slice element located.

Exceptions

KeyNotFoundException

Thrown if this TextureRegion does not contain a Slice element with the specified name.

GetSlice<T>(string)

Returns the Slice element with the specified name from this TextureRegion as the type specified.

public T GetSlice<T>(string name) where T : Slice

Parameters

name string

The name of the Slice element to locate.

Returns

T

The Slice element located as the type specified.

Type Parameters

T

The type to return the located Slice element as. Must derived from the base type Slice.