Search Unity

Question Scaling UI Elements with a Preserve Aspect Parent.

Discussion in 'UGUI & TextMesh Pro' started by RobbieNI, Jun 12, 2020.

  1. RobbieNI

    RobbieNI

    Joined:
    Nov 8, 2017
    Posts:
    19
    Hi there,

    I'm curious if it's possible to scale and or anchor child UI elements in line with its parent image when that image has preserve aspect turned on.

    I've attached a gif, you can see that when we change to a wider aspect ratio the text gets moved up. I know why this is happening but I'm wondering if there's a way I can also anchor it in line with its parent image.
     

    Attached Files:

  2. Hosnkobf

    Hosnkobf

    Joined:
    Aug 23, 2016
    Posts:
    1,096
    Yes, but instead of preserve aspect you need to add an aspect ratio fitter component.
     
    tahirkahramanov likes this.