Table of Contents

Class SpriteSheet

Namespace
Stride.Graphics
Assembly
Stride.Graphics.dll

A sheet (group) of sprites.

[DataContract]
[DataSerializerGlobal(typeof(ReferenceSerializer<SpriteSheet>), null, DataSerializerGenericMode.None, false, false, Profile = "Content")]
[ContentSerializer(typeof(DataContentSerializer<SpriteSheet>))]
public class SpriteSheet
Inheritance
SpriteSheet

Properties

this[int]

Gets or sets the image of the group at index.

public Sprite this[int index] { get; set; }

Parameters

index int

The image index

Property Value

Sprite

The image

this[string]

Gets or sets the image of the group having the provided name.

public Sprite this[string name] { get; set; }

Parameters

name string

The name of the image

Property Value

Sprite

The image

Sprites

The list of sprites.

public List<Sprite> Sprites { get; }

Property Value

List<Sprite>

Methods

FindImageIndex(string)

Find the index of a sprite in the group using its name.

public int FindImageIndex(string spriteName)

Parameters

spriteName string

The name of the sprite

Returns

int

The index value

Remarks

If two sprites have the provided name then the first sprite found is returned

Exceptions

KeyNotFoundException

No sprite in the group have the given name