Search Unity

How do I not use a layout in ugui

Discussion in 'Scripting' started by unity_M0SlTBB5vVKbzA, Feb 14, 2020.

  1. unity_M0SlTBB5vVKbzA

    unity_M0SlTBB5vVKbzA

    Joined:
    Feb 14, 2020
    Posts:
    4
    Writing some GUI for the Unity Editor and would like every item to be aligned to the parents origin, overlapping. ie: style.top and style.left should be (0, 0) at parents (0, 0). Is there any way to do this?
     
  2. Antistone

    Antistone

    Joined:
    Feb 22, 2014
    Posts:
    2,836
    I'm a bit unclear on the question.

    If you want a UI object to stay in a fixed position relative to some corner of the parent, you can do that by setting its anchors to that corner.

    If you're trying to get the child to have the same coordinate system as the parent, I don't believe that's possible in the editor. If you're working in script, you can always convert everything to world coordinates if you like.