Search Unity

Screen Resolution for Android - Texture Getting Cropped

Discussion in 'Android' started by getbiks, Oct 22, 2012.

  1. getbiks

    getbiks

    Joined:
    May 13, 2012
    Posts:
    20
    Hi, I am making a 2D game for android and basically my game has a fixed background the game elements are all in front.
    The game elements and evrything is running fine but when I test the game in different phones with different resolution and aspect ratio, i get different results.
    The background texture is getting cropped in other devices.

    I have set the camera resolution in unity to 3:2 and have made the background adjustment accordingly.
    Please suggest on how do i correct this issue. I have searched a lot in the forums but have not gotten into any result as yet.
     
  2. getbiks

    getbiks

    Joined:
    May 13, 2012
    Posts:
    20
    ok guys.. seems no answer from you guys yet.. but i have been trying to see if i can come up with some kind of solution and incase anybody is wondering how i solve it.. here you go..

    first, I had a high texture in my project.. (1280*800) as that is the max resolution i am gonna support. Next what i did was.. i calculated the aspect ratio.. and adjusted my view according to the 1280*720 view as default.. and wrote a script where in the game checks the screen width at the starting of the game.. and according to the screen width it will adjust the width of my BG. I have noticed that the camera scales according to the height of the screen.. so i dont have to adjust the height.. its just the width that is to be adjusted.. also it looks bit stretchy.. but then its fine.. also i have adjusted all the different elements which is nearer to the screen according to the screen height and width. the main game elements are fine.. as its in the centre so they dont need to be adjusted.