SpriteSheet Class
Namespace: Stride.GraphicsAssembly: Stride.Graphics.dll
A sheet (group) of sprites.
System.Object →
SpriteSheet
Derived from SpriteSheet:
[DataContract]
[DataSerializerGlobal(typeof(ReferenceSerializer<SpriteSheet>), null, DataSerializerGenericMode.None, false, false, Profile = "Content")]
[ContentSerializer(typeof(DataContentSerializer<SpriteSheet>))]
public class SpriteSheet
| Name | Description | |
|---|---|---|
| Properties | ||
| Item[Int32] | Gets or sets the image of the group at |
|
| Item[String] | Gets or sets the image of the group having the provided |
|
| Sprites | The list of sprites. |
|
| Methods | ||
| FindImageIndex(String) | Find the index of a sprite in the group using its name. |
|
Properties
Item[Int32]
Gets or sets the image of the group at index.
public Sprite this[int index] { get; set; }
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | index | The image index |
Property Value
| Type | Description |
|---|---|
| Sprite | The image |
Item[String]
Gets or sets the image of the group having the provided name.
public Sprite this[string name] { get; set; }
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The name of the image |
Property Value
| Type | Description |
|---|---|
| Sprite | The image |
Sprites
The list of sprites.
public List<Sprite> Sprites { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.List<Sprite> |
Methods
FindImageIndex(String)
Find the index of a sprite in the group using its name.
public int FindImageIndex(string spriteName)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | spriteName | The name of the sprite |
Returns
| Type | Description |
|---|---|
| System.Int32 | The index value |
Remarks
If two sprites have the provided name then the first sprite found is returned
Exceptions
| Type | Condition |
|---|---|
| System.Collections.Generic.KeyNotFoundException | No sprite in the group have the given name |