Struct micro_ldtk::ldtk::LayerInstance
source · pub struct LayerInstance {Show 24 fields
pub c_hei: i64,
pub c_wid: i64,
pub grid_size: i64,
pub identifier: String,
pub opacity: f64,
pub px_total_offset_x: i64,
pub px_total_offset_y: i64,
pub tileset_def_uid: Option<i64>,
pub tileset_rel_path: Option<String>,
pub layer_instance_type: String,
pub auto_layer_tiles: Vec<TileInstance>,
pub entity_instances: Vec<EntityInstance>,
pub grid_tiles: Vec<TileInstance>,
pub iid: String,
pub int_grid: Option<Vec<IntGridValueInstance>>,
pub int_grid_csv: Vec<i64>,
pub layer_def_uid: i64,
pub level_id: i64,
pub optional_rules: Vec<i64>,
pub override_tileset_uid: Option<i64>,
pub px_offset_x: i64,
pub px_offset_y: i64,
pub seed: i64,
pub visible: bool,
}Fields§
§c_hei: i64Grid-based height
c_wid: i64Grid-based width
grid_size: i64Grid size
identifier: StringLayer definition identifier
opacity: f64Layer opacity as Float [0-1]
px_total_offset_x: i64Total layer X pixel offset, including both instance and definition offsets.
px_total_offset_y: i64Total layer Y pixel offset, including both instance and definition offsets.
tileset_def_uid: Option<i64>The definition UID of corresponding Tileset, if any.
tileset_rel_path: Option<String>The relative path to corresponding Tileset, if any.
layer_instance_type: StringLayer type (possible values: IntGrid, Entities, Tiles or AutoLayer)
auto_layer_tiles: Vec<TileInstance>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.
entity_instances: Vec<EntityInstance>§grid_tiles: Vec<TileInstance>§iid: StringUnique layer instance identifier
int_grid: Option<Vec<IntGridValueInstance>>WARNING: this deprecated value is no longer exported since version 1.0.0 Replaced
by: intGridCsv
int_grid_csv: Vec<i64>A list of all values in the IntGrid layer, stored in CSV format (Comma Separated
Values).
Order is 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.
The array size is __cWid x __cHei cells.
layer_def_uid: i64Reference the Layer definition UID
level_id: i64Reference to the UID of the level containing this layer instance
optional_rules: Vec<i64>An Array containing the UIDs of optional rules that were enabled in this specific layer instance.
override_tileset_uid: Option<i64>This layer can use another tileset by overriding the tileset UID here.
px_offset_x: i64X offset in pixels to render this layer, usually 0 (IMPORTANT: this should be added to
the LayerDef optional offset, so you should probably prefer using __pxTotalOffsetX
which contains the total offset value)
px_offset_y: i64Y offset in pixels to render this layer, usually 0 (IMPORTANT: this should be added to
the LayerDef optional offset, so you should probably prefer using __pxTotalOffsetX
which contains the total offset value)
seed: i64Random seed used for Auto-Layers rendering
visible: boolLayer instance visibility
Trait Implementations§
source§impl AsRef<LayerInstance> for LdtkLayer
impl AsRef<LayerInstance> for LdtkLayer
source§fn as_ref(&self) -> &LayerInstance
fn as_ref(&self) -> &LayerInstance
source§impl Clone for LayerInstance
impl Clone for LayerInstance
source§fn clone(&self) -> LayerInstance
fn clone(&self) -> LayerInstance
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for LayerInstance
impl Debug for LayerInstance
source§impl<'de> Deserialize<'de> for LayerInstance
impl<'de> Deserialize<'de> for LayerInstance
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl From<&LayerInstance> for LayerType
impl From<&LayerInstance> for LayerType
source§fn from(value: &LayerInstance) -> Self
fn from(value: &LayerInstance) -> Self
source§impl PartialEq for LayerInstance
impl PartialEq for LayerInstance
source§fn eq(&self, other: &LayerInstance) -> bool
fn eq(&self, other: &LayerInstance) -> bool
self and other values to be equal, and is used
by ==.source§impl Serialize for LayerInstance
impl Serialize for LayerInstance
impl StructuralPartialEq for LayerInstance
Auto Trait Implementations§
impl RefUnwindSafe for LayerInstance
impl Send for LayerInstance
impl Sync for LayerInstance
impl Unpin for LayerInstance
impl UnwindSafe for LayerInstance
Blanket Implementations§
§impl<T, U> AsBindGroupShaderType<U> for T
impl<T, U> AsBindGroupShaderType<U> for T
§fn as_bind_group_shader_type(&self, _images: &RenderAssets<Image>) -> U
fn as_bind_group_shader_type(&self, _images: &RenderAssets<Image>) -> U
T [ShaderType] for self. When used in [AsBindGroup]
derives, it is safe to assume that all images in self exist.source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.