Search Unity

Draw certain UI elements above others ignoring the hierarchy

Discussion in 'UGUI & TextMesh Pro' started by Legi, Aug 24, 2014.

  1. Legi

    Legi

    Joined:
    Jul 25, 2013
    Posts:
    20
    I'm using the layout components to arrange my elements.

    I have a grid of buttons (2x2 grid). If i click on a button, i'm displaying a drop down menu which has the button as parent, so i can anchor it properly. The problem is that the other buttons of that grid are below the top left button in the hierarchy and therefore above the drop down menu...

    Unity Grid Draw Order.png

    I would like to have that menu drawn above all other buttons and still be anchored to one of them...
     
  2. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,225
    The popup menu is transient so a simple way to do this is to add an 'update' function to the popup window that moves the popup to the correct location each tick. This could be set as the thing to render last on the canvas.