Struct ldtk2::Coordinate [−][src]
This file is a JSON schema of files created by LDtk level editor (https://ldtk.io).
This is the root of any Project JSON file. It contains: - the project settings, - an array of levels, - and a definition object (that can probably be safely ignored for most users).
Fields
backup_limit: i64
Number of backup files to keep, if the backupOnSave
is TRUE
backup_on_save: bool
If TRUE, an extra copy of the project will be created in a sub folder, when saving.
bg_color: String
Project background color
default_grid_size: i64
Default grid size for new layers
default_level_bg_color: String
Default background color of levels
default_pivot_x: f64
Default X pivot (0 to 1) for new entities
default_pivot_y: f64
Default Y pivot (0 to 1) for new entities
defs: Option<Definitions>
A structure containing all the definitions of this project
export_png: bool
If TRUE, all layers in all levels will also be exported as PNG along with the project file (default is FALSE)
export_tiled: bool
If TRUE, a Tiled compatible file will also be generated along with the LDtk JSON file (default is FALSE)
external_levels: bool
If TRUE, one file will be saved for the project (incl. all its definitions) and one file in a sub-folder for each level.
json_version: String
File format version
levels: Vec<Level>
All levels. The order of this array is only relevant in LinearHorizontal
and
linearVertical
world layouts (see worldLayout
value). Otherwise, you should refer to
the worldX
,worldY
coordinates of each Level.
minify_json: bool
If TRUE, the Json is partially minified (no indentation, nor line breaks, default is FALSE)
next_uid: i64
png_file_pattern: Option<String>
File naming pattern for exported PNGs
world_grid_height: i64
Height of the world grid in pixels.
world_grid_width: i64
Width of the world grid in pixels.
world_layout: Option<WorldLayout>
An enum that describes how levels are organized in this project (ie. linearly or in a 2D
space). Possible values: Free
, GridVania
, LinearHorizontal
, LinearVertical
Implementations
impl Coordinate
[src]
pub fn from_file<P: AsRef<Path>>(path: P) -> Result<Self, Box<dyn Error>>
[src]
pub fn from_str<S: AsRef<str>>(s: S) -> Result<Self, Box<dyn Error>>
[src]
Trait Implementations
impl<'de> Deserialize<'de> for Coordinate
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Serialize for Coordinate
[src]
Auto Trait Implementations
impl RefUnwindSafe for Coordinate
[src]
impl Send for Coordinate
[src]
impl Sync for Coordinate
[src]
impl Unpin for Coordinate
[src]
impl UnwindSafe for Coordinate
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,