Search Unity

[UIElements] Bringing an Element to the front

Discussion in 'UIElements' started by col000r, Nov 1, 2018.

  1. col000r

    col000r

    Joined:
    Mar 27, 2008
    Posts:
    654
    In the docs it just says
    This led me on a wild ride to try and get the id of the current element in the list of children on its parent and then try to move stuff around in there, but as it turns out there's a really easy way to bring an element to the front: target.BringToFront();

    And there's other options too:
    SendToBack()
    PlaceBehind(sibling)
    PlaceInFront(sibling)

    Leaving this here to save future generations...