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

UI element gets rescaled by Unity?

Discussion in 'UGUI & TextMesh Pro' started by patrick1306, Oct 18, 2022.

  1. patrick1306

    patrick1306

    Joined:
    Oct 28, 2014
    Posts:
    4
    I am trying to make a card game with Unity, if I set the game to full HD everything looks and behave perfectly normal and looks like this:

    However, if I set the aspect ratio to anything else the cards get rescaled like this:


    Only the cards get rescaled, everything else is more or less fine.
    The canvas is set to "Screen Space Overlay" and "Scale with screen size".
    This is what the cards prefabs looks like:




    Any idea how to fix this and why it is happening?
     
  2. Cornysam

    Cornysam

    Joined:
    Feb 8, 2018
    Posts:
    1,353
    Not entirely sure without messing around in your project, but i would recommend using Grid Layout Groups for the areas it makes sense. upload_2022-10-18_14-53-16.png

    The blue circles i drew are where i think a grid layout group would make sense.
     
  3. d40route

    d40route

    Joined:
    Oct 16, 2022
    Posts:
    2
    they are already in layouts.
    The player hand (bottom one) is a horizontal layout and the market (the one on the right) is a grid layout.

    I wonder if the layouts are actually what’s causing this…?
     
  4. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,951
  5. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    10,620
    I'll move your post to the correct forum. The UI forum. Please use the 2D forum to ask about 2D features and not UGUI.

    Thanks.