Skip to main content

Level

Struct Level 

Source
pub struct Level {
Show 15 fields pub bg_color: String, pub bg_pos: Option<BackgroundPosition>, pub neighbours: Vec<Neighbour>, pub bg_rel_path: Option<String>, pub external_rel_path: Option<String>, pub field_instances: Vec<FieldInstance>, pub identifier: String, pub iid: String, pub layer_instances: Option<Vec<LayerInstance>>, pub px_hei: Int, pub px_wid: Int, pub uid: Int, pub world_depth: Int, pub world_x: Int, pub world_y: Int,
}

Fields§

§bg_color: String

Background color of the level (same as bgColor, except the default value is automatically used here if its value is null)

§bg_pos: Option<BackgroundPosition>

Position informations of the background image, if there is one.

§neighbours: Vec<Neighbour>

An array listing all other levels touching this one on the world map. Only relevant for world layouts where level spatial positioning is manual (ie. GridVania, Free). For Horizontal and Vertical layouts, this array is always empty.

§bg_rel_path: Option<String>

The optional relative path to the level background image.

§external_rel_path: Option<String>

This value is not null if the project option “Save levels separately” is enabled. In this case, this relative path points to the level Json file.

§field_instances: Vec<FieldInstance>

An array containing this level custom field values.

§identifier: String

User defined unique identifier

§iid: String

Unique instance identifier

§layer_instances: Option<Vec<LayerInstance>>

An array containing all Layer instances. IMPORTANT: if the project option “Save levels separately” is enabled, this field will be null. This array is sorted in display order: the 1st layer is the top-most and the last is behind.

§px_hei: Int

Height of the level in pixels

§px_wid: Int

Width of the level in pixels

§uid: Int

Unique Int identifier

§world_depth: Int

Index that represents the “depth” of the level in the world. Default is 0, greater means “above”, lower means “below”. This value is mostly used for display only and is intended to make stacking of levels easier to manage.

§world_x: Int

World X coordinate in pixels. Only relevant for world layouts where level spatial positioning is manual (ie. GridVania, Free). For Horizontal and Vertical layouts, the value is always -1 here.

§world_y: Int

World Y coordinate in pixels. Only relevant for world layouts where level spatial positioning is manual (ie. GridVania, Free). For Horizontal and Vertical layouts, the value is always -1 here.

Trait Implementations§

Source§

impl Clone for Level

Source§

fn clone(&self) -> Level

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<'de> Deserialize<'de> for Level

Source§

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

Deserialize this value from the given Serde deserializer. Read more

Auto Trait Implementations§

§

impl Freeze for Level

§

impl RefUnwindSafe for Level

§

impl Send for Level

§

impl Sync for Level

§

impl Unpin for Level

§

impl UnsafeUnpin for Level

§

impl UnwindSafe for Level

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>,