Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Anchor more than 2 target

Discussion in 'UGUI & TextMesh Pro' started by tnbao91, Nov 26, 2015.

  1. tnbao91

    tnbao91

    Joined:
    Sep 5, 2013
    Posts:
    46
    I used to use NGUI before switching to uGUI. You can anchor a widget UI to more than 1 target (no need parent) with NGUI. But If use uGUI, I just can anchor it to parent only. I want to anchor my widget left to object A and anchor right to object B. So anyone deal with it?

    Look like this anchor system below

     
  2. tnbao91

    tnbao91

    Joined:
    Sep 5, 2013
    Posts:
    46
    Up ! No one needs this feature?
     
  3. Prodigga

    Prodigga

    Joined:
    Apr 13, 2011
    Posts:
    1,121
    Depends on what you want to do, you can generally recreate what you could do with multi target anchors by using the new layout system.

    For example, if you want a UI element to fill the horizontal space between 2 other UI elements, you could place those 3 elements in to a horizontal layout, give each of them a layout component and enable flexible width on the middle layout component. That'll get it to fill the gap between the other 2 elements.
     
    Last edited: Nov 30, 2015
  4. tnbao91

    tnbao91

    Joined:
    Sep 5, 2013
    Posts:
    46
    But I don't put them to the same place, they have difference parent so can't use layout element