Class Tileset
Inheritance
System.Object
Tileset
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: LdtkParser.Graphics
Assembly: LdtkParser.dll
Syntax
public class Tileset
Constructors
Tileset(Texture2D, Int32, Int32, Int32)
Declaration
public Tileset(Texture2D txt, int width, int height, int gridSize)
Parameters
| Type | Name | Description |
|---|---|---|
| Microsoft.Xna.Framework.Graphics.Texture2D | txt | |
| System.Int32 | width | |
| System.Int32 | height | |
| System.Int32 | gridSize |
Fields
Texture
Declaration
public Texture2D Texture
Field Value
| Type | Description |
|---|---|
| Microsoft.Xna.Framework.Graphics.Texture2D |
Properties
Height
Declaration
public int Height { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
NumTiles
Declaration
public int NumTiles { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
TileGridSize
Declaration
public int TileGridSize { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
Width
Declaration
public int Width { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
Methods
GetTileById(Int32)
Gets the Rectangle for a given tile id on the Tileset. LDtk starts IDs at 0, where the ID can be unpacked using width and gridsize.
Declaration
public Rectangle GetTileById(int tileId)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | tileId | The ID we want |
Returns
| Type | Description |
|---|---|
| Microsoft.Xna.Framework.Rectangle | A Rectangle that describes our tile on this tileset |
Exceptions
| Type | Condition |
|---|---|
| InvalidTileException | Thrown when the id is out of bounds for this tileset |