Table of Contents

Class SpriteSheet

Namespace
MonoEight.Core.Sprite
Assembly
MonoEight.Template.dll

A collection of sprites sliced from a larger texture

public class SpriteSheet
Inheritance
SpriteSheet
Inherited Members

Constructors

SpriteSheet(Texture2D, Point)

Initializes a new instance of the SpriteSheet from the given Microsoft.Xna.Framework.Graphics.Texture2D.

public SpriteSheet(Texture2D texture, Point size)

Parameters

texture Texture2D

The Microsoft.Xna.Framework.Graphics.Texture2D that will be sliced.

size Point

The size of a single sprite in the sheet.

SpriteSheet(Texture2D, int)

public SpriteSheet(Texture2D texture, int size)

Parameters

texture Texture2D

size int

The size of a single sprite in the sheet.

SpriteSheet(Texture2D, int, int[])

public SpriteSheet(Texture2D texture, int size, int[] indices)

Parameters

texture Texture2D

size int

The size of a single sprite in the sheet.

indices int[]

The indices to keep from the sliced sheet.

Properties

Count

Gets the total number of sprites in this sheet.

public int Count { get; }

Property Value

int

this[int]

Gets the sprite Microsoft.Xna.Framework.Graphics.Texture2D at the given index.

public Texture2D this[int index] { get; }

Parameters

index int

The index of the sprite.

Property Value

Texture2D

The sprite Microsoft.Xna.Framework.Graphics.Texture2D.

Exceptions

IndexOutOfRangeException

Thrown if the index is invalid.

Methods

Get(int)

Gets the sprite Microsoft.Xna.Framework.Graphics.Texture2D at the given index.

public Texture2D Get(int index)

Parameters

index int

The index of the sprite.

Returns

Texture2D

The sprite Microsoft.Xna.Framework.Graphics.Texture2D.

Exceptions

IndexOutOfRangeException

Thrown if the index is invalid.