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
sourceimpl Clone for Definitions
impl Clone for Definitions
sourcefn clone(&self) -> Definitions
fn clone(&self) -> Definitions
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for Definitions
impl Debug for Definitions
sourceimpl<'de> Deserialize<'de> for Definitions
impl<'de> Deserialize<'de> for Definitions
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl Serialize for Definitions
impl Serialize for Definitions
Auto Trait Implementations
impl RefUnwindSafe for Definitions
impl Send for Definitions
impl Sync for Definitions
impl Unpin for Definitions
impl UnwindSafe for Definitions
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more