• 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 Level

Inheritance
System.Object
Level
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
Assembly: LdtkParser.dll
Syntax
public class Level

Constructors

Level(Int32, String, Int32, Int32)

Declaration
public Level(int uid, string name, int worldX, int worldY)
Parameters
Type Name Description
System.Int32 uid
System.String name
System.Int32 worldX
System.Int32 worldY

Level(Int32, String, Int32, Int32, Texture2D, Point)

Declaration
public Level(int uid, string name, int worldX, int worldY, Texture2D background, Point bgPosition)
Parameters
Type Name Description
System.Int32 uid
System.String name
System.Int32 worldX
System.Int32 worldY
Microsoft.Xna.Framework.Graphics.Texture2D background
Microsoft.Xna.Framework.Point bgPosition

Properties

BackgroundImage

Declaration
public Texture2D BackgroundImage { get; }
Property Value
Type Description
Microsoft.Xna.Framework.Graphics.Texture2D

BackgroundPosition

Declaration
public Point BackgroundPosition { get; }
Property Value
Type Description
Microsoft.Xna.Framework.Point

LevelName

Declaration
public string LevelName { get; }
Property Value
Type Description
System.String

Uid

Declaration
public int Uid { get; }
Property Value
Type Description
System.Int32

WorldX

Declaration
public int WorldX { get; }
Property Value
Type Description
System.Int32

WorldY

Declaration
public int WorldY { get; }
Property Value
Type Description
System.Int32

Methods

AddLayer(ILayer)

Declaration
public void AddLayer(ILayer layer)
Parameters
Type Name Description
ILayer layer

AddNeighbour(Int32, String)

Declaration
public void AddNeighbour(int uid, string direction)
Parameters
Type Name Description
System.Int32 uid
System.String direction

GetLayerByName<T>(String)

Returns the layer of given name if found

Declaration
public T GetLayerByName<T>(string name)

    where T : ILayer
Parameters
Type Name Description
System.String name

The name of the layer

Returns
Type Description
T

A layer

Type Parameters
Name Description
T

An ILayer type (Tiles, IntGrid, Entities)

GetLayers<T>()

Returns layers where T can be Tiles, IntGrid, Entities.

Declaration
public IEnumerable<T> GetLayers<T>()
Returns
Type Description
System.Collections.Generic.IEnumerable<T>

All found layers

Type Parameters
Name Description
T

An ILayer type (Tiles, IntGrid, Entities)

GetNeighbourUid(Direction)

Returns the level UID for the neighbour in the bearing

Declaration
public int GetNeighbourUid(Direction dir)
Parameters
Type Name Description
Direction dir

The direction of the neighbour (North, East, South, West) as generated by LDtk

Returns
Type Description
System.Int32

The uid for the given neighbour or -1 if not found.

In This Article
Back to top Generated by DocFX