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. Dismiss Notice

Resize depend on device resulation by new ui

Discussion in 'UGUI & TextMesh Pro' started by mtGameDev, Jan 3, 2015.

  1. mtGameDev

    mtGameDev

    Joined:
    Oct 19, 2012
    Posts:
    89


    I made it in unity by new ui system but when I tested it in my 10.1 tablet, I saw that my buttons dont resize depend on different screens. I know that I can set positions depend on resulation by Anchor vut I dont know how I can resize them in different resulation.
     
  2. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    Use a canvas scaler, set it to scale with screen size and set match width or height to 1.
     
  3. mtGameDev

    mtGameDev

    Joined:
    Oct 19, 2012
    Posts:
    89
    Where is canvas scaler my friend ??!!!!
     
  4. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
  5. mtGameDev

    mtGameDev

    Joined:
    Oct 19, 2012
    Posts:
    89
    I wonder I havent canvas scaler !!
    I have canvas, canvas group, canvas renderer !!!
    there isnt canvas scaler !!
    Can u give me the script file ???
     
  6. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    It is backup and update time!
     
  7. mtGameDev

    mtGameDev

    Joined:
    Oct 19, 2012
    Posts:
    89
    Oh yes thanx my friend. You help me alot.
     
  8. mtGameDev

    mtGameDev

    Joined:
    Oct 19, 2012
    Posts:
    89
  9. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    Get it to work without generating it and then make sure to use those for the generation as well.
     
  10. mtGameDev

    mtGameDev

    Joined:
    Oct 19, 2012
    Posts:
    89
    But i have to generate buttons by codes.
     
  11. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    It is complex to get it right like that. So make one step back and get it working at all, such that you understand what settings are needed. When you got that, generate it by code.