[−][src]Struct ldtk_rust::Level
This section contains all the level data. It can be found in 2 distinct forms, depending
on Project current settings: - If "Separate level files" is disabled (default):
full level data is embedded inside the main Project JSON file, - If "Separate level
files" is enabled: level data is stored in separate standalone .ldtkl
files (one
per level). In this case, the main Project JSON file will still contain most level data,
except heavy sections, like the layerInstances
array (which will be null). The
externalRelPath
string points to the ldtkl
file. A ldtkl
file is just a JSON file
containing exactly what is described below.
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<LevelBackgroundPosition>
Position informations of the background image, if there is one.
neighbours: Vec<NeighbourLevel>
An array listing all other levels touching this one on the world map. In "linear" world
layouts, this array is populated with previous/next levels in array, and dir
depends on
the linear horizontal/vertical layout.
level_bg_color: Option<String>
Background color of the level. If null
, the project defaultLevelBgColor
should be
used.
bg_pivot_x: f64
Background image X pivot (0-1)
bg_pivot_y: f64
Background image Y pivot (0-1)
level_bg_pos: Option<BgPos>
An enum defining the way the background image (if any) is positioned on the level. See
__bgPos
for resulting position info. Possible values: Unscaled
, Contain
, Cover
,
CoverDirty
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.
identifier: String
Unique String 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: i64
Height of the level in pixels
px_wid: i64
Width of the level in pixels
uid: i64
Unique Int identifier
world_x: i64
World X coordinate in pixels
world_y: i64
World Y coordinate in pixels
Implementations
impl Level
[src]
Trait Implementations
impl<'de> Deserialize<'de> for Level
[src]
pub fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Serialize for Level
[src]
Auto Trait Implementations
impl RefUnwindSafe for Level
[src]
impl Send for Level
[src]
impl Sync for Level
[src]
impl Unpin for Level
[src]
impl UnwindSafe for Level
[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>,