Search Unity

Cannot resize Canvas in edit mode

Discussion in 'UGUI & TextMesh Pro' started by Kylotan, Sep 2, 2014.

  1. Kylotan

    Kylotan

    Joined:
    Feb 17, 2011
    Posts:
    212
    In the lesson videos, there is a demonstration of temporarily moving the canvas extents to test the resizing and layout functionality as it applies to elements on that canvas. (Then it would snap back to normal when the mouse is released.) I tried it myself to begin with and this worked well.

    But on my second project using the UI, I am finding that the canvas does not resize when dragged - I can grab the edges and drag, and while it shows the dimension value along the edge, nothing moves at all. Am I missing something?
     
  2. StarManta

    StarManta

    Joined:
    Oct 23, 2006
    Posts:
    8,775
    When you select that object, are the RectTransform controls in the inspector grayed out? And possibly say 'Some values driven by XX'?
     
  3. Kylotan

    Kylotan

    Joined:
    Feb 17, 2011
    Posts:
    212
    Yes, the whole RectTransform is greyed out and it says "Some values driven by Canvas". On the Canvas itself. (Which doesn't have any layout components attached, if it matters. But some children do.)
     
  4. JAKJ

    JAKJ

    Joined:
    Aug 17, 2014
    Posts:
    185
    That means the canvas is in Overlay or Camera mode, and is being automatically fitted.
     
    MarekNijaki and paulrich_nb like this.
  5. Kylotan

    Kylotan

    Joined:
    Feb 17, 2011
    Posts:
    212
    Ah yes, I knew that, but thought it was still possible to drag it around temporarily. And it is - but you have to have a child element selected. Not a child of a child, or anything else, but a child of the element you want to preview in a different size.
     
  6. JAKJ

    JAKJ

    Joined:
    Aug 17, 2014
    Posts:
    185
    You can also just put the game in Free Aspect and drag the scene or game window around in the inspector to change its ratio and size.
     
  7. runevision

    runevision

    Joined:
    Nov 28, 2007
    Posts:
    1,892
    If you can drag the edges and it says "preview", but it doesn't actually affect the graphics, then it might be a bug. If so, please file a bug report with repro project and description of repro steps. Thanks!
     
  8. Kylotan

    Kylotan

    Joined:
    Feb 17, 2011
    Posts:
    212
    It's ok, it was user error in this case. I just didn't realise that you can only drag the parent of the currently selected object.
     
    dr31z0r likes this.
  9. nmanring

    nmanring

    Joined:
    Jul 22, 2023
    Posts:
    1
    Hi - newbie here. So how do you change Overlay or Camera mode... can you describe the fix. And how do I put it in "Free Aspect" ... can we say the resolution out loud and not just the problem? hah thanks