Struct 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: i64

Grid-based height

§c_wid: i64

Grid-based width

§grid_size: i64

Grid size

§identifier: String

Layer definition identifier

§opacity: f64

Layer opacity as Float [0-1]

§px_total_offset_x: i64

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

§px_total_offset_y: i64

Total 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: String

Layer 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: String

Unique 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: i64

Reference the Layer definition UID

§level_id: i64

Reference 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: i64

X 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: i64

Y 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: i64

Random seed used for Auto-Layers rendering

§visible: bool

Layer instance visibility

Trait Implementations§

Source§

impl Clone for LayerInstance

Source§

fn clone(&self) -> LayerInstance

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 LayerInstance

Source§

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

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

impl<'de> Deserialize<'de> for LayerInstance

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 LdtkLayerExtensions for LayerInstance

Source§

fn grid_to_world(&self, x: i32, y: i32) -> Vec2

Source§

fn px_to_world(&self, position: Vec2) -> Vec2

Source§

impl Serialize for LayerInstance

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> 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<S> FromSample<S> for S

Source§

fn from_sample_(s: S) -> S

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<F, T> IntoSample<T> for F
where T: FromSample<F>,

Source§

fn into_sample(self) -> T

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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> ToSample<U> for T
where U: FromSample<T>,

Source§

fn to_sample_(self) -> U

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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> Any for T
where T: Any,

Source§

impl<T> CloneAny for T
where T: Any + Clone,

Source§

impl<T> Component for T
where T: Send + Sync + 'static,

Source§

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

Source§

impl<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,

Source§

impl<T> SerializableAny for T
where T: 'static + Any + Clone + for<'a> Send + Sync,