Struct ldtk2::LayerDefinition

source ·
pub struct LayerDefinition {
Show 34 fields pub layer_definition_type: String, pub auto_rule_groups: Vec<AutoLayerRuleGroup>, pub auto_source_layer_def_uid: Option<i64>, pub auto_tileset_def_uid: Option<i64>, pub auto_tiles_killed_by_other_layer_uid: Option<i64>, pub biome_field_uid: Option<i64>, pub can_select_when_inactive: bool, pub display_opacity: f64, pub doc: Option<String>, pub excluded_tags: Vec<String>, pub grid_size: i64, pub guide_grid_hei: i64, pub guide_grid_wid: i64, pub hide_fields_when_inactive: bool, pub hide_in_list: bool, pub identifier: String, pub inactive_opacity: f64, pub int_grid_values: Vec<IntGridValueDefinition>, pub int_grid_values_groups: Vec<IntGridValueGroupDefinition>, pub parallax_factor_x: f64, pub parallax_factor_y: f64, pub parallax_scaling: bool, pub px_offset_x: i64, pub px_offset_y: i64, pub render_in_world_view: bool, pub required_tags: Vec<String>, pub tile_pivot_x: f64, pub tile_pivot_y: f64, pub tileset_def_uid: Option<i64>, pub purple_type: Type, pub ui_color: Option<String>, pub uid: i64, pub ui_filter_tags: Vec<String>, pub use_async_render: bool,
}

Fields§

§layer_definition_type: String

Type of the layer (IntGrid, Entities, Tiles or AutoLayer)

§auto_rule_groups: Vec<AutoLayerRuleGroup>

Contains all the auto-layer rule definitions.

§auto_source_layer_def_uid: Option<i64>§auto_tileset_def_uid: Option<i64>

WARNING: this deprecated value is no longer exported since version 1.2.0 Replaced by: tilesetDefUid

§auto_tiles_killed_by_other_layer_uid: Option<i64>§biome_field_uid: Option<i64>§can_select_when_inactive: bool

Allow editor selections when the layer is not currently active.

§display_opacity: f64

Opacity of the layer (0 to 1.0)

§doc: Option<String>

User defined documentation for this element to provide help/tips to level designers.

§excluded_tags: Vec<String>

An array of tags to forbid some Entities in this layer

§grid_size: i64

Width and height of the grid in pixels

§guide_grid_hei: i64

Height of the optional “guide” grid in pixels

§guide_grid_wid: i64

Width of the optional “guide” grid in pixels

§hide_fields_when_inactive: bool§hide_in_list: bool

Hide the layer from the list on the side of the editor view.

§identifier: String

User defined unique identifier

§inactive_opacity: f64

Alpha of this layer when it is not the active one.

§int_grid_values: Vec<IntGridValueDefinition>

An array that defines extra optional info for each IntGrid value.
WARNING: the array order is not related to actual IntGrid values! As user can re-order IntGrid values freely, you may value “2” before value “1” in this array.

§int_grid_values_groups: Vec<IntGridValueGroupDefinition>

Group informations for IntGrid values

§parallax_factor_x: f64

Parallax horizontal factor (from -1 to 1, defaults to 0) which affects the scrolling speed of this layer, creating a fake 3D (parallax) effect.

§parallax_factor_y: f64

Parallax vertical factor (from -1 to 1, defaults to 0) which affects the scrolling speed of this layer, creating a fake 3D (parallax) effect.

§parallax_scaling: bool

If true (default), a layer with a parallax factor will also be scaled up/down accordingly.

§px_offset_x: i64

X offset of the layer, in pixels (IMPORTANT: this should be added to the LayerInstance optional offset)

§px_offset_y: i64

Y offset of the layer, in pixels (IMPORTANT: this should be added to the LayerInstance optional offset)

§render_in_world_view: bool

If TRUE, the content of this layer will be used when rendering levels in a simplified way for the world view

§required_tags: Vec<String>

An array of tags to filter Entities that can be added to this layer

§tile_pivot_x: f64

If the tiles are smaller or larger than the layer grid, the pivot value will be used to position the tile relatively its grid cell.

§tile_pivot_y: f64

If the tiles are smaller or larger than the layer grid, the pivot value will be used to position the tile relatively its grid cell.

§tileset_def_uid: Option<i64>

Reference to the default Tileset UID being used by this layer definition.
WARNING: some layer instances might use a different tileset. So most of the time, you should probably use the __tilesetDefUid value found in layer instances.
Note: since version 1.0.0, the old autoTilesetDefUid was removed and merged into this value.

§purple_type: Type

Type of the layer as Haxe Enum Possible values: IntGrid, Entities, Tiles, AutoLayer

§ui_color: Option<String>

User defined color for the UI

§uid: i64

Unique Int identifier

§ui_filter_tags: Vec<String>

Display tags

§use_async_render: bool

Asynchronous rendering option for large/complex layers

Trait Implementations§

source§

impl Clone for LayerDefinition

source§

fn clone(&self) -> LayerDefinition

Returns a copy 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 LayerDefinition

source§

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

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

impl<'de> Deserialize<'de> for LayerDefinition

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 LayerDefinition

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

§

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

§

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

§

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