Search Unity

Center UI elements smartly

Discussion in 'UI Toolkit' started by Gonzasmpl, Sep 6, 2019.

  1. Gonzasmpl

    Gonzasmpl

    Joined:
    Jul 30, 2018
    Posts:
    55
    Hi, i'm relatively new to unity UI so i thought about making a "word filler" app to get some practise. I use ScriptableObjets to store data such as images and their related names, etc.

    The point is that i want character boxes to appear in the screen so that you know how many characters and words forms the respective "name". I would like these boxes to be centered and have space between two adjacent words, something like a normal sentence but made of fillable boxes.
    I have thought about using Grid Layout Group component to achieve this but i think it's not possible as different words may be in lower lines if the entire sentence does not fit in one single line.

    Any suggestion to achieve something like this is highly appreciated. Thanks!
     
  2. HugoBD-Unity

    HugoBD-Unity

    Unity Technologies

    Joined:
    May 14, 2018
    Posts:
    497
  3. Gonzasmpl

    Gonzasmpl

    Joined:
    Jul 30, 2018
    Posts:
    55
    You are right, thanks!