Struct LayerDef

Source
pub struct LayerDef {
Show 17 fields pub px_offset_y: i32, pub tile_pivot_y: f32, pub layer_def_type: Value, pub uid: i32, pub auto_source_layer_def_uid: Option<i32>, pub display_opacity: f32, pub __type: String, pub excluded_tags: Vec<String>, pub grid_size: i32, pub tile_pivot_x: f32, pub auto_tileset_def_uid: Option<i32>, pub px_offset_x: i32, pub identifier: String, pub auto_rule_groups: Vec<AutoLayerRuleGroup>, pub int_grid_values: Vec<IntGridValueDef>, pub required_tags: Vec<String>, pub tileset_def_uid: Option<i32>,
}
Expand description

Fields§

§px_offset_y: i32

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

§tile_pivot_y: f32

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.

§layer_def_type: Value

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

§uid: i32

Unique Int identifier

§auto_source_layer_def_uid: Option<i32>
§display_opacity: f32

Opacity of the layer (0 to 1.0)

§__type: String

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

§excluded_tags: Vec<String>

An array of tags to forbid some Entities in this layer

§grid_size: i32

Width and height of the grid in pixels

§tile_pivot_x: f32

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.

§auto_tileset_def_uid: Option<i32>

Reference to the Tileset UID being used by this auto-layer rules. WARNING: some layer instances might use a different tileset. So most of the time, you should probably use the __tilesetDefUid value from layer instances.

§px_offset_x: i32

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

§identifier: String

Unique String identifier

§auto_rule_groups: Vec<AutoLayerRuleGroup>

Contains all the auto-layer rule definitions.

§int_grid_values: Vec<IntGridValueDef>

An array that defines extra optional info for each IntGrid value. The array is sorted using value (ascending).

§required_tags: Vec<String>

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

§tileset_def_uid: Option<i32>

Reference to the Tileset UID being used by this Tile layer. WARNING: some layer instances might use a different tileset. So most of the time, you should probably use the __tilesetDefUid value from layer instances.

Trait Implementations§

Source§

impl Clone for LayerDef

Source§

fn clone(&self) -> LayerDef

Returns a duplicate 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 LayerDef

Source§

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

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

impl<'de> Deserialize<'de> for LayerDef

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 LayerDef

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

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> 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<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,