pub struct MapLayer {
pub tilemap: Tilemap,
pub visible: bool,
pub opacity: f32,
pub scroll_factor: (f32, f32),
pub blend_mode: BlendMode,
pub z_index: i32,
pub no_animation: bool,
pub level: i32,
}Expand description
A single layer in the map rendering stack.
Each layer owns a Tilemap and carries display properties that
control how it is positioned and blended relative to other layers.
Fields§
§tilemap: TilemapThe tilemap data for this layer.
visible: boolWhether this layer should be drawn. Invisible layers are skipped entirely during compositing.
opacity: f32Global opacity: 0.0 = fully transparent, 1.0 = fully opaque.
scroll_factor: (f32, f32)Parallax scroll factor.
(1.0, 1.0) means the layer scrolls at the same rate as the camera.
(0.5, 0.5) means the layer scrolls at half the camera speed (distant
background), and (2.0, 2.0) means it scrolls faster (foreground).
blend_mode: BlendModeHow this layer blends with layers rendered below it.
z_index: i32Sort order. Lower values are rendered first (behind).
no_animation: boolWhen true, the layer’s content does not animate frame-to-frame. Renderers may cache pre-rendered tiles for performance.
level: i32Elevation level this layer belongs to (0 = ground, the default).
Multi-level maps split rendering at the player’s elevation: layers
with level <= player_elevation render below sprites, layers above
render over them.