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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

How do you make your game look the same on multiple devices?

Discussion in 'Android' started by HowWeLife, Jul 21, 2015.

  1. HowWeLife

    HowWeLife

    Joined:
    Jul 4, 2015
    Posts:
    51
    New to Unity and have been learning trough tutorials, however none of the tutorials talk about making the game look the same across all devices (iOS included).

    Does unity automatically scale everything to look the same on all devices or is there something you have to do ?

    Also what is the difference between a UI and an image i just drag into the hierarchy? Because UI's have anchor points.

    I am very confused by this and can't seem to find a solid answer.
     
  2. Taz-dragon

    Taz-dragon

    Joined:
    May 21, 2015
    Posts:
    38
    I'm assuming what you want is the default quality settings, which can be found in Edit>Project Settings>Quality.
     
  3. jgb143

    jgb143

    Joined:
    Jun 8, 2010
    Posts:
    132
    You have to take that all into account when designing your game. The UI canvas will scale to the size of the actual screen and you can anchor UI elements to that so a button in the top left corner will always be in the top left corner for example. There are different options available to scale things differently, but again, that depends on the design of your game and UI.

    Familiarize yourself with the documentation and just play around with it some until you become used to it.
    http://docs.unity3d.com/Manual/UICanvas.html
    http://docs.unity3d.com/Manual/HOWTO-UIMultiResolution.html
    http://docs.unity3d.com/Manual/script-CanvasScaler.html

    What I did for my latest game(which was pretty much made using only the new UI) was design the app for one of the skinnier aspect ratios and fit that to the actual screen size vertically, then pad the left and right of the screen with the background color(if the screen is wider). The options button I anchored to the actual top corner so it wouldn't be as obvious. This worked well for my game but you have to take these things into account on a case by case basis.
     
    HowWeLife likes this.
  4. HowWeLife

    HowWeLife

    Joined:
    Jul 4, 2015
    Posts:
    51
    Thank you! Also if i want to use an image (say i eant the image to be a player) should i do that using the ui? Just wondering because i want the players to stay the same size regardless of device. So would using the ui and anchor points help achieve that? Or should you just use the image as a sprite? Since (i think) unity automatically scales those depending on the screen.
     
  5. Taz-dragon

    Taz-dragon

    Joined:
    May 21, 2015
    Posts:
    38
    I'm not sure if I understand, but it should scale.
     
  6. HowWeLife

    HowWeLife

    Joined:
    Jul 4, 2015
    Posts:
    51
    I think I'm just not explaining well. Sorry for the confusion, i'll try to explain myself better .

    Im using a sprite as a character (as I believe everyone does ). To build my game my Game View's aspect ratio is set to 16:10 portrait. However not all devices use the same aspect ratio.

    For example if I put my Character in the corner in the Game View I can see all of him. However when I test it on my phone, you can only see half of him as the screen is to small.

    I know with UI elements you can anchor images buttons etc to be at a position relative to the canvas. For Example if i made my character a UI Image and anchored him to the corner he will always show completely.

    But you don't use UI elements for characters .(I mean I guess you could but its not a good idea right?) and Sprites have no anchors (that I know off) So how do you make it so that the game will look the same on all devices?

    If I'm still to confusing let me know and ill try to explain things in more detailed, but I hope this helps you understand my question better and thank you for helping!
     
    Aappo likes this.
  7. jgb143

    jgb143

    Joined:
    Jun 8, 2010
    Posts:
    132
    Again, it depends on your game and your own design decisions(and what would make the most sense for your game). You could letterbox/pillbox the view. That way it would look exactly the same on all devices, just on some you would loose some of the screen(this is sort of what I did but my game was all UI). You could scroll the background so the corner of your world, room, game screen, or whatever will always line up with the corner of the screen when you move to it. You could keep your character aligned toward the center of the screen and scroll the background(this would be an easy way to achieve the previous option. Really, it all depends on your game.
     
    HowWeLife likes this.