Table of Contents

Method CreateSprite

Namespace
MonoGame.Aseprite
Assembly
MonoGame.Aseprite.dll

CreateSprite(AsepriteFile, GraphicsDevice, int, ProcessorOptions?)

Creates a new Sprite from the specified frame index of the provided aseprite file instance.

public static Sprite CreateSprite(this AsepriteFile aseFile, GraphicsDevice device, int frameIndex, ProcessorOptions? options = null)

Parameters

aseFile AsepriteFile

The aseprite file instance.

device GraphicsDevice

The graphics device used to create graphical resources.

frameIndex int

The index of the frame in the aseprite file to create the sprite from.

options ProcessorOptions

The options to use when processing the sprite.

Returns

Sprite

The Sprite created by this method.

Exceptions

ArgumentNullException

Thrown if the aseFile parameter is null.

-or-

Thrown if the device parameter is null.

ArgumentOutOfRangeException

Thrown if frameIndex is less than zero or greater than or equal to the total number of frames in the aseprite file.