-collision debug is shown above all else, fixes #2985

This commit is contained in:
Juan Linietsky 2015-12-12 08:11:36 -03:00
parent 990690f9f5
commit 9251298f46
3 changed files with 29 additions and 6 deletions

View file

@ -77,6 +77,11 @@ void CollisionShape2D::_notification(int p_what) {
case NOTIFICATION_ENTER_TREE: {
unparenting=false;
can_update_body=get_tree()->is_editor_hint();
if (!get_tree()->is_editor_hint()) {
//display above all else
set_z_as_relative(false);
set_z(VS::CANVAS_ITEM_Z_MAX-1);
}
} break;
case NOTIFICATION_LOCAL_TRANSFORM_CHANGED: {
@ -120,6 +125,7 @@ void CollisionShape2D::_notification(int p_what) {
rect=Rect2();
Color draw_col=get_tree()->get_debug_collisions_color();
shape->draw(get_canvas_item(),draw_col);