pub struct Layer {
pub name: String,
pub offset_x: f32,
pub offset_y: f32,
pub opacity: f32,
pub properties: HashMap<String, TiledValue>,
pub layer_type: LayerType,
pub x: i32,
pub y: i32,
}Expand description
A map can contain any number of layers.
Layers have sub-types such as (enum) LayerType::TileLayer(TileLayer)
which contains the data for that sub-type.
Fields§
§name: String§offset_x: f32Horizontal layer offset in pixels (default: 0)
offset_y: f32Vertical layer offset in pixels (default: 0)
opacity: f32Value between 0 and 1
properties: HashMap<String, TiledValue>§layer_type: LayerTypeThe LayerType object also contains the data relating to the type
x: i32Horizontal layer offset in tiles. Always 0.
y: i32Vertical layer offset in tiles. Always 0.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Layer
impl<'de> Deserialize<'de> for Layer
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>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Layer
Auto Trait Implementations§
impl Freeze for Layer
impl RefUnwindSafe for Layer
impl Send for Layer
impl Sync for Layer
impl Unpin for Layer
impl UnwindSafe for Layer
Blanket Implementations§
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
Mutably borrows from an owned value. Read more