Crate ldtk_rust[−][src]
This library parses JSON generated by LDtk (Level Designers ToolKit) for use in Rust. It is designed to be usable in any Rust program, including all game frameworks.
Most users will want to start by reviewing the top level Project struct and in particular the Project::new() method. Calling this method will load in all of your LDtk data. See the library’s /examples subdirectory for more detailed examples.
Project::new(f: String) --- loads all the data Project::load_project(f: String) --- loads only the project file Level::new(f: String) --- loads a single external level file
Structs
AutoLayerRuleDefinition | This complex section isn’t meant to be used by game devs at all, as these rules are completely resolved internally by the editor before any saving. You should just ignore this part. |
AutoLayerRuleGroup | |
Definitions | A structure containing all the definitions of this project |
EntityDefinition | |
EntityInstance | |
EntityInstanceTile | Tile data in an Entity instance |
EnumDefinition | |
EnumValueDefinition | |
FieldDefinition | This section is mostly only intended for the LDtk editor app itself. You can safely ignore it. |
FieldInstance | |
IntGridValueDefinition | IntGrid value definition |
IntGridValueInstance | IntGrid value instance |
LayerDefinition | |
LayerInstance | |
LdtkJson | Deprecated |
Level | This section contains all the level data. It can be found in 2 distinct forms, depending
on Project current settings: - If “Separate level files” is disabled (default):
full level data is embedded inside the main Project JSON file, - If “Separate level
files” is enabled: level data is stored in separate standalone |
LevelBackgroundPosition | Level background image position info |
NeighbourLevel | Nearby level info |
Project | This file is a JSON schema of files created by LDtk level editor (https://ldtk.io). |
TileInstance | This structure represents a single tile from a given Tileset. |
TilesetDefinition | The |
Enums
BgPos | |
Checker | Checker mode Possible values: |
EditorDisplayMode | Possible values: |
EditorDisplayPos | Possible values: |
Flag | |
LimitBehavior | Possible values: |
LimitScope | If TRUE, the maxCount is a “per world” limit, if FALSE, it’s a “per level”. Possible
values: |
RenderMode | Possible values: |
TextLangageMode | |
TileMode | Defines how tileIds array is used Possible values: |
TileRenderMode | Possible values: |
Type | Type of the layer as Haxe Enum Possible values: |
WorldLayout | An enum that describes how levels are organized in this project (ie. linearly or in a 2D
space). Possible values: |