From 0ae85df770a611e87aff682ef8765b800e2dba69 Mon Sep 17 00:00:00 2001 From: badlogic Date: Tue, 10 May 2022 12:18:44 +0200 Subject: [PATCH] [godot] Set nodes under SpineSprite to draw behind parent for debug rendering to work. --- spine-godot/spine_godot/SpineSprite.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/spine-godot/spine_godot/SpineSprite.cpp b/spine-godot/spine_godot/SpineSprite.cpp index 0d4c46732..a921e0122 100644 --- a/spine-godot/spine_godot/SpineSprite.cpp +++ b/spine-godot/spine_godot/SpineSprite.cpp @@ -286,6 +286,10 @@ void SpineSprite::sort_slot_nodes() { auto draw_order = skeleton->get_spine_object()->getDrawOrder(); for (int i = 0; i < get_child_count(); i++) { + auto child = cast_to(get_child(i)); + if (!child) continue; + // Needed so that debug drawables are rendered in front of attachments and other nodes under the sprite. + child->set_draw_behind_parent(true); auto slot_node = Object::cast_to(get_child(i)); if (!slot_node) continue; if (slot_node->get_slot_index() == -1 || slot_node->get_slot_index() >= (int)draw_order.size()) {