Struct Project

Source
pub struct Project {
Show 24 fields pub backup_on_save: bool, pub default_pivot_y: f32, pub level_name_pattern: String, pub export_png: Option<bool>, pub world_grid_width: i32, pub default_level_height: i32, pub world_grid_height: i32, pub world_layout: Value, pub flags: Vec<Value>, pub image_export_mode: Value, pub default_level_bg_color: String, pub json_version: String, pub default_level_width: i32, pub levels: Vec<Level>, pub default_pivot_x: f32, pub png_file_pattern: Option<String>, pub default_grid_size: i32, pub next_uid: i32, pub backup_limit: i32, pub defs: Definitions, pub external_levels: bool, pub minify_json: bool, pub bg_color: String, pub export_tiled: bool,
}
Expand description

This is the root of any Project JSON file. It contains: - the project settings, - an array of levels, - a group of definitions (that can probably be safely ignored for most users).

Fields§

§backup_on_save: bool

If TRUE, an extra copy of the project will be created in a sub folder, when saving.

§default_pivot_y: f32

Default Y pivot (0 to 1) for new entities

§level_name_pattern: String

The default naming convention for level identifiers.

§export_png: Option<bool>

WARNING: this deprecated value is no longer exported since version 0.9.3 Replaced by: imageExportMode

§world_grid_width: i32

Width of the world grid in pixels.

§default_level_height: i32

Default new level height

§world_grid_height: i32

Height of the world grid in pixels.

§world_layout: Value

An enum that describes how levels are organized in this project (ie. linearly or in a 2D space). Possible values: Free, GridVania, LinearHorizontal, LinearVertical

§flags: Vec<Value>

An array containing various advanced flags (ie. options or other states). Possible values: DiscardPreCsvIntGrid, IgnoreBackupSuggest

§image_export_mode: Value

“Image export” option when saving project. Possible values: None, OneImagePerLayer, OneImagePerLevel

§default_level_bg_color: String

Default background color of levels

§json_version: String

File format version

§default_level_width: i32

Default new level width

§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.

§default_pivot_x: f32

Default X pivot (0 to 1) for new entities

§png_file_pattern: Option<String>

File naming pattern for exported PNGs

§default_grid_size: i32

Default grid size for new layers

§next_uid: i32

Next Unique integer ID available

§backup_limit: i32

Number of backup files to keep, if the backupOnSave is TRUE

§defs: Definitions

A structure containing all the definitions of this project

§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.

§minify_json: bool

If TRUE, the Json is partially minified (no indentation, nor line breaks, default is FALSE)

§bg_color: String

Project background color

§export_tiled: bool

If TRUE, a Tiled compatible file will also be generated along with the LDtk JSON file (default is FALSE)

Trait Implementations§

Source§

impl Clone for Project

Source§

fn clone(&self) -> Project

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Project

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Project

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for Project

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

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