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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.