Struct ldtk::LayerInstance[][src]

pub struct LayerInstance {
Show fields pub __px_total_offset_y: i32, pub int_grid_csv: Vec<i32>, pub px_offset_x: i32, pub entity_instances: Vec<EntityInstance>, pub __tileset_def_uid: Option<i32>, pub __type: String, pub __opacity: f32, pub __px_total_offset_x: i32, pub __identifier: String, pub __tileset_rel_path: Option<String>, pub __c_wid: i32, pub grid_tiles: Vec<Tile>, pub optional_rules: Vec<i32>, pub __c_hei: i32, pub visible: bool, pub auto_layer_tiles: Vec<Tile>, pub level_id: i32, pub override_tileset_uid: Option<i32>, pub seed: i32, pub layer_def_uid: i32, pub __grid_size: i32, pub px_offset_y: i32, pub int_grid: Option<Vec<IntGridValueInstance>>,
}

Fields

__px_total_offset_y: i32

Total layer Y pixel offset, including both instance and definition offsets.

int_grid_csv: Vec<i32>

A list of all values in the IntGrid layer, stored from left to right, and top to bottom (ie. first row from left to right, followed by second row, etc). 0 means “empty cell” and IntGrid values start at 1. This array size is __cWid x __cHei cells.

px_offset_x: i32

X offset in pixels to render this layer, usually 0 (IMPORTANT: this should be added to the LayerDef optional offset, see __pxTotalOffsetX)

entity_instances: Vec<EntityInstance>
__tileset_def_uid: Option<i32>

The definition UID of corresponding Tileset, if any.

__type: String

Layer type (possible values: IntGrid, Entities, Tiles or AutoLayer)

__opacity: f32

Layer opacity as Float [0-1]

__px_total_offset_x: i32

Total layer X pixel offset, including both instance and definition offsets.

__identifier: String

Layer definition identifier

__tileset_rel_path: Option<String>

The relative path to corresponding Tileset, if any.

__c_wid: i32

Grid-based width

grid_tiles: Vec<Tile>
optional_rules: Vec<i32>

An Array containing the UIDs of optional rules that were enabled in this specific layer instance.

__c_hei: i32

Grid-based height

visible: bool

Layer instance visibility

auto_layer_tiles: Vec<Tile>

An array containing all tiles generated by Auto-layer rules. The array is already sorted in display order (ie. 1st tile is beneath 2nd, which is beneath 3rd etc.).

Note: if multiple tiles are stacked in the same cell as the result of different rules, all tiles behind opaque ones will be discarded.

level_id: i32

Reference to the UID of the level containing this layer instance

override_tileset_uid: Option<i32>

This layer can use another tileset by overriding the tileset UID here.

seed: i32

Random seed used for Auto-Layers rendering

layer_def_uid: i32

Reference the Layer definition UID

__grid_size: i32

Grid size

px_offset_y: i32

Y offset in pixels to render this layer, usually 0 (IMPORTANT: this should be added to the LayerDef optional offset, see __pxTotalOffsetY)

int_grid: Option<Vec<IntGridValueInstance>>

WARNING: this deprecated value will be removed completely on version 0.10.0+ Replaced by: intGridCsv

Trait Implementations

impl Clone for LayerInstance[src]

impl Debug for LayerInstance[src]

impl<'de> Deserialize<'de> for LayerInstance[src]

impl Serialize for LayerInstance[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

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

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.