Search Unity

Parent scale to scale many items UI?

Discussion in 'UGUI & TextMesh Pro' started by prankard, Oct 28, 2014.

  1. prankard

    prankard

    Joined:
    Mar 24, 2010
    Posts:
    19
    Hey :),

    I'm having some trouble figuring out a solution to a problem with the new UI system.
    I can see it's really flexible so I'm sure it's possible but I just don't know how.

    So I'm trying to parent lots of images (or content), to another image, or rect transform.
    Then I would like all items (parented) to be scaled uniformly depending on the screen width.

    But for the life of me I can't figure it out.
    So pictures are better than words.

    This is me positioning all the images on an example screen resolution and it's all in place:
    upload_2014-10-28_18-23-37.png

    And this is me changing the resolution, note red arrow, I would like all content to be bigger inside (whilst preserving aspect ratios).
    upload_2014-10-28_18-25-13.png

    I basically want a credits screen. For me to position all elements and then for it to scale to it's width and then I can use the scroll rect to scroll it all.

    Any suggestions on how to achieve this? And thanks for reading.
     

    Attached Files:

  2. Marble

    Marble

    Joined:
    Aug 29, 2005
    Posts:
    1,268
    You're adjusting the width of the RectTransform here, not its scale (try using the scale tool). It sounds like you want these elements to be on a Canvas with a CanvasScaler component attached.
     
  3. pollyox16

    pollyox16

    Joined:
    Feb 7, 2014
    Posts:
    13
    Attach the referenceresolution component to your canvas. That should work.
     
  4. Marble

    Marble

    Joined:
    Aug 29, 2005
    Posts:
    1,268
    Note that the current beta no longer has a ReferenceResolution component. It has been replaced by the CanvasScaler.
     
  5. pollyox16

    pollyox16

    Joined:
    Feb 7, 2014
    Posts:
    13
    good to know. I havent updated yet. ill check that out. thank you.
     
  6. prankard

    prankard

    Joined:
    Mar 24, 2010
    Posts:
    19
    Thanks for you're help on this.
    I've used the ReferenceResolution / CanvasScaler and it's worked.
    Makes me want to go back and re-do a few of the other screens now I know this. It's so much easier to do what I want with that component.