Is it possible to draw the child of a node above its neighbors?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Nick Smith
:warning: Old Version Published before Godot 3 was released.

I have a conveyor belt node that holds items in an isometric view and I’d like to draw the items on the conveyor belt above the next isometric tile’s conveyor belt. The items get drawn above their own parent, but dip below the parent’s neighbor; is there a way to prevent this?

:bust_in_silhouette: Reply From: avencherus

A sort of straight forward way is to elevate the Z value of your Node2D to be higher than the tiles in question.

There are a variety of approaches, depending on your design. If you have something complex, maybe you need an algorithm to adjust these values of tiles and objects in real time.

Another method is to separate out what you want above the tiles into another CanvasItem (Node2D), or even create a new CanvasLayer for hold those nodes, and elevate the layer number.

Wow, that is incredibly simple. Thanks!

Nick Smith | 2017-11-01 17:10

No problem. X)

avencherus | 2017-11-01 17:12