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 moreSource§impl Debug for Definitions
impl Debug for Definitions
Source§impl<'de> Deserialize<'de> for Definitions
impl<'de> Deserialize<'de> for Definitions
Source§fn 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>,
Auto Trait Implementations§
impl Freeze for Definitions
impl RefUnwindSafe for Definitions
impl Send for Definitions
impl Sync for Definitions
impl Unpin for Definitions
impl UnwindSafe for Definitions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more