Screen cropped issue in unity 2-D game

后端 未结 2 980
自闭症患者
自闭症患者 2020-12-20 00:48

I developed one 2-D game in unity. First I have run game on web player my screen is cutting from both ends. Now I am creating android apk from it. Then on android devices it

相关标签:
2条回答
  • 2020-12-20 01:20

    Since you are making a 2D game, I presume you are using the orthogonal camera. Unlike perspective camera, the orthogonal camera shows more stuff on the screen the bigger resolution you have.

    You need to normalize the orthogonal size to a wanted resolution:

     camera.orthographicSize = 640/screenwidth * screenheight/2
    

    In the above code the orthogonal size is normalized to 640 pixel width. (Link)

    0 讨论(0)
  • 2020-12-20 01:24

    Free Aspect is just the current game view. This does not reflect what will be seen in the final product. I recommend using one of the preset ratio's or if your up to date with Unity3d you can add your own custom resolutions.

    So if you designing for phone when its vertical (GS4 used as an example) you can set it to 1080x1920. This will give you a better representation as to what you will see on your device.

    0 讨论(0)
提交回复
热议问题