Struct ldtk::Definitions[][src]

pub struct Definitions {
    pub layers: Vec<LayerDef>,
    pub enums: Vec<EnumDef>,
    pub entities: Vec<EntityDef>,
    pub external_enums: Vec<EnumDef>,
    pub tilesets: Vec<TilesetDef>,
    pub level_fields: Vec<FieldDef>,
}

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.

Fields

layers: Vec<LayerDef>

All layer definitions

enums: Vec<EnumDef>

All internal enums

entities: Vec<EntityDef>

All entities definitions, including their custom fields

external_enums: Vec<EnumDef>

Note: external enums are exactly the same as enums, except they have a relPath to point to an external source file.

tilesets: Vec<TilesetDef>

All tilesets

level_fields: Vec<FieldDef>

All custom fields available to all levels.

Trait Implementations

impl Clone for Definitions[src]

impl Debug for Definitions[src]

impl<'de> Deserialize<'de> for Definitions[src]

impl Serialize for Definitions[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.