Skip to content

Commit

Permalink
Drop Shadow: Use inverse Z-Index positioning to undo all layer indexing
Browse files Browse the repository at this point in the history
Useful for ensuring shadow will always be "behind" the TileMap (or
TileMapLayer) regardless of desired zindex of the object.
  • Loading branch information
Eoin-ONeill-Yokai committed Oct 31, 2024
1 parent d0db0cd commit 9b2cd46
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scene/2d/tile_map_layer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ void TileMapLayer::_rendering_update(bool p_force_cleanup) {

rs->canvas_item_set_z_as_relative_to_parent(dropshadow_ci, true);
rs->canvas_item_set_draw_behind_parent(dropshadow_ci, true);
rs->canvas_item_set_z_index(dropshadow_ci, tile_z_index - 1);
rs->canvas_item_set_z_index(dropshadow_ci, -1 - get_z_index());

rs->canvas_item_set_default_texture_filter(dropshadow_ci, RS::CanvasItemTextureFilter(get_texture_filter_in_tree()));
rs->canvas_item_set_default_texture_repeat(dropshadow_ci, RS::CanvasItemTextureRepeat(get_texture_repeat_in_tree()));
Expand Down

0 comments on commit 9b2cd46

Please sign in to comment.