Search Unity

Question Size of text-Field is influenced by the text-string?

Discussion in '2D' started by JulianWallerius, Sep 13, 2021.

  1. JulianWallerius

    JulianWallerius

    Joined:
    Dec 13, 2020
    Posts:
    2
    Hey, I have a problem:

    I would like to have 2 (or more) text-GameObjects in one line, so that each GameObject has the exact same width. They need to have the same size.
    So I took a VerticalLayoutGroup, packed it on top of a Panel, set the LayoutGroup to control ChildWidth and arranged everything, so the text-GameObjects get streched across the screen. So good so far.
    But the text-Objects aren't edited to the exact same size, because the strings, that are in them, don't have the same length. So, if a string in a text-Object is longer than in a different text-Object, the width of the text-Object gets bigger, than it should be, when the space is divided equally. I don't want that.

    Maybe you can help me.
    Thanks
     
  2. MarekUnity

    MarekUnity

    Unity Technologies

    Joined:
    Jan 6, 2017
    Posts:
    207