• Api Documentation
Show / Hide Table of Contents
  • LdtkParser
    • Direction
    • ILayer
    • ILdtkEntity
    • IWorld
    • LayerType
    • Level
    • World
  • LdtkParser.Exceptions
    • EntityNotFoundException
    • FieldStoreException
    • InvalidTileException
    • TilesetNotFoundException
  • LdtkParser.Graphics
    • ColorConverter
    • Sprite
    • SpriteEnum
    • Tileset
  • LdtkParser.Json
    • BgPos
    • CachedPixelData
    • DefaultOverride
    • Defs
    • Entity
    • EntityInstance
    • Enum
    • FieldDef
    • FieldInstance
    • GridTile
    • Header
    • IntGrid
    • IntGridValue
    • Layer
    • LayerInstance
    • Level
    • Neighbour
    • Param
    • Project
    • RealEditorValue
    • Serialize
    • Tile
    • Tileset
    • TypeClass
    • TypeUnion
    • Value
    • ValueClass
    • ValueUnion
  • LdtkParser.Layers
    • Entities
    • EntityModel
    • EnumValue
    • FieldStore
    • IntGrid
    • Tiles

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

In This Article
Back to top Generated by DocFX