Search Unity

Sprite Background with Different Screen Sizes

Discussion in '2D' started by s34nvideos, Sep 30, 2019.

  1. s34nvideos

    s34nvideos

    Joined:
    Sep 28, 2019
    Posts:
    4
    What is the most sensible method for having a my sprite background stretch or crop for different screen sizes? How do you guys usually manage that?

    I have followed a lot of tutorials, but they fail to mention little things like this which allow me to get games into production.

    Do I do everything on a Canvas and anchor that?
    Do I write script to manage this?

    Unity seems to have so many features, I thought there would be an inbuilt facility to manage this.

    Thanks in advance
     
  2. coidevoid

    coidevoid

    Joined:
    Oct 26, 2017
    Posts:
    55
  3. s34nvideos

    s34nvideos

    Joined:
    Sep 28, 2019
    Posts:
    4
    That was the only solution that I found.... Other than a C# script somebody posted elsewhere

    But if this is what everybody is doing, and how it should be done, then why doesn't Unity Canvas by default? or why dont any of the tutorials recommend this? What is everybody doing about this? What is the norm? Any insight from anybody that has made a 2D game for multiple devices?

    I dont really want to get started into a project and my main UI design is wrong lol. I want to get it nailed down first before I get into it.
     
  4. coidevoid

    coidevoid

    Joined:
    Oct 26, 2017
    Posts:
    55
    Well I believe it is used by default when you're adding a new UI element to your scene the canvas scaler will be there automatically.
    I'm working on PC projects only and for me that feature always worked as expected