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

Positioning UI text with script

Discussion in 'UGUI & TextMesh Pro' started by MindSpyke, Jan 23, 2016.

  1. MindSpyke

    MindSpyke

    Joined:
    Sep 13, 2013
    Posts:
    14
    So I have a panel with 2 text elements and I want to set their position relative to their parent in a script , however my script isn't setting the position right : / Link for reference ... http://imgur.com/CJveSbG

    what's the correct way of positioning a text element relative to it's parent?

    Sorry for so many questions lately , but this UI stuff is pretty new for me
    ty
     
  2. MindSpyke

    MindSpyke

    Joined:
    Sep 13, 2013
    Posts:
    14
    after some extensive googling and fiddling around with the anchors of my text elements if got it working :D
    solution was to use drag the anchors of the text element to the corners of the parent element and set the pivot to the bottom left
     
    Last edited: Jan 23, 2016