Setting z-index for individual layers #194
-
Is there a way to set z-index for individual layers? I have a tiled map with different layers according to where it's z-index should be relative to the player i.e. above / below. Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
update: I figured out how to do this. However, after a few seconds, each layer with a z-index higher than my player sprite disappears for some reason. |
Beta Was this translation helpful? Give feedback.
-
When inserting the .insert_bundle(TilemapBundle {
grid_size: TilemapGridSize {
x: TILE_SIZE as f32,
y: TILE_SIZE as f32,
},
size: tilemap_size,
storage: tile_storage,
texture: TilemapTexture(image_handle),
tile_size,
transform: Transform::from_xyz(0.0, 0.0, z),
..Default::default()
}); |
Beta Was this translation helpful? Give feedback.
update: I figured out how to do this. However, after a few seconds, each layer with a z-index higher than my player sprite disappears for some reason.