Class SpriteSheet
Inherited Members
Namespace: Genesis.Graphics
Assembly: Genesis.dll
Syntax
public class SpriteSheet
Constructors
SpriteSheet(string, Vec3, Texture)
Initializes a new instance of the SpriteSheet class.
Declaration
public SpriteSheet(string name, Vec3 tileResolution, Texture texture)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | The name of the sprite sheet. |
| Vec3 | tileResolution | The resolution of each tile in the sprite sheet. |
| Texture | texture | The texture used for the sprite sheet. |
Properties
Columns
Gets the number of columns in the sprite sheet.
Declaration
public int Columns { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
Name
Gets or sets the name of the sprite sheet.
Declaration
public string Name { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Rows
Gets the number of rows in the sprite sheet.
Declaration
public int Rows { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
Texture
Gets or sets the texture used for the sprite sheet.
Declaration
public Texture Texture { get; set; }
Property Value
| Type | Description |
|---|---|
| Texture |
TileResolution
Gets or sets the resolution of each tile in the sprite sheet.
Declaration
public Vec3 TileResolution { get; set; }
Property Value
| Type | Description |
|---|---|
| Vec3 |
UUID
Gets the UUID of the sprite sheet.
Declaration
public string UUID { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Methods
GetSprite(float, float)
Retrieves the texture coordinates for the specified tile in the sprite sheet.
Declaration
public TexCoords GetSprite(float col, float row)
Parameters
| Type | Name | Description |
|---|---|---|
| float | col | Column index of the tile (starting from 0). |
| float | row | Row index of the tile (starting from 0). |
Returns
| Type | Description |
|---|---|
| TexCoords | The texture coordinates of the specified tile. |