Search Unity

Question Vertical HUD panels with square view

Discussion in 'UGUI & TextMesh Pro' started by MoonJellyGames, Oct 12, 2021.

  1. MoonJellyGames

    MoonJellyGames

    Joined:
    Oct 2, 2014
    Posts:
    331
    I wasn't getting any responses on my other thread about this from a couple of weeks ago. I know that double-posting is generally a "no-no", but I figure I may have posted in the wrong forum the first time.

    Anyways...

    I need to have two vertical UI panels; one on each side of the screen. Their height needs to scale to the height of the screen, and the width needs to scale in such a way that the space between them (the actual game view) is perfectly square. I've worked with UI components before, but it's always been a struggle for me, so I'm looking for some pointers on how to set this up so that the UI components on each vertical panel aren't all messed up at different screen sizes.

    Any suggestions for how to get started would be greatly appreciated.
     
  2. JuliaP_Unity

    JuliaP_Unity

    Unity Technologies

    Joined:
    Mar 26, 2020
    Posts:
    698
    Hello! Before we get to an answer, just making sure you're using UI Toolkit because Unity has 2 UI systems for games right now (UI Toolkit and UGUI) and the answers would be very different!

    So are you using the Canvas component? Or do you have UXML/USS files and a PanelSettings?
     
  3. MoonJellyGames

    MoonJellyGames

    Joined:
    Oct 2, 2014
    Posts:
    331
    I'm using the Canvas component. I didn't even know there was an alternative. Hah
     
  4. JuliaP_Unity

    JuliaP_Unity

    Unity Technologies

    Joined:
    Mar 26, 2020
    Posts:
    698
    I've transferred this post to the UGUI Forum, let's see if someone can help you here :cool:
     
    MoonJellyGames likes this.