Search Unity

Unity UI [SOLVED] Clamp Rotated Rect to Fill Parent (AspectRatioFitter that works with rotation)

Discussion in 'Unity UI (uGUI) & TextMesh Pro' started by jschieck, Jan 5, 2018.

  1. jschieck

    jschieck

    Joined:
    Nov 10, 2010
    Posts:
    363
    I'm attempting to create a custom Aspect Ratio Fitter that works when the RectTransform has rotation. Essentially I need the EnvelopeParent functionality, but force the rect to stretch to fill no matter the Z rotation of the transform. Having trouble coming up with a solution. Anyone tackled this before?

    upload_2018-1-5_9-55-50.png
     
  2. jschieck

    jschieck

    Joined:
    Nov 10, 2010
    Posts:
    363
    Nevermind figure it out.
     
  3. Heykinox

    Heykinox

    Joined:
    Sep 28, 2013
    Posts:
    3
    How?
    I have the same problem
     
  4. Heykinox

    Heykinox

    Joined:
    Sep 28, 2013
    Posts:
    3
    I was able to fix this problem by putting my aspect ratio fitter into a parent that is in the same direction (up points towards the same up). When the AspectRatioFitter and its parent are in the same direction, it seems to be working properly.