Struct ldtk2::Definitions
source · pub struct Definitions {
pub entities: Vec<EntityDefinition>,
pub enums: Vec<EnumDefinition>,
pub external_enums: Vec<EnumDefinition>,
pub layers: Vec<LayerDefinition>,
pub level_fields: Vec<FieldDefinition>,
pub tilesets: Vec<TilesetDefinition>,
}
Expand description
If you’re writing your own LDtk importer, you should probably just ignore most stuff in
the defs
section, as it contains data that are mostly important to the editor. To keep
you away from the defs
section and avoid some unnecessary JSON parsing, important data
from definitions is often duplicated in fields prefixed with a double underscore (eg.
__identifier
or __type
). The 2 only definition types you might need here are
Tilesets and Enums.
A structure containing all the definitions of this project
Fields§
§entities: Vec<EntityDefinition>
All entities definitions, including their custom fields
enums: Vec<EnumDefinition>
All internal enums
external_enums: Vec<EnumDefinition>
Note: external enums are exactly the same as enums
, except they have a relPath
to
point to an external source file.
layers: Vec<LayerDefinition>
All layer definitions
level_fields: Vec<FieldDefinition>
All custom fields available to all levels.
tilesets: Vec<TilesetDefinition>
All tilesets
Trait Implementations§
source§impl Clone for Definitions
impl Clone for Definitions
source§fn clone(&self) -> Definitions
fn clone(&self) -> Definitions
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more