- Home /
How do I build apk that works on galaxy s8 aspect ratio (18.5/9)?
Hi, I want to run my android game on my galaxy S8 which has an aspect ratio of 18.5/9 (not the usual 16/9).. But when I run it on the device the game uses only part of the screen (probably 16/9 letterbox)
How do I allow the game to run on 18.5/9 aspect ratio?
Thank you! :D
Answer by Animatick · Sep 26, 2017 at 10:33 PM
The way I solved this issue for me is setting the canvas to scale to screen width/height, and setting a base resolution. It should automatically scale according to your screen size. also if you are trying to scale the game camera to the screen something like this may help
public float distance = 10;
public float goDepth = 1;
Vector3 v3ViewPort;
Vector3 v3BottomLeft;
Vector3 v3TopRight;
// Use this for initialization
void Awake () {
distance -= (goDepth * 0.5f);
v3ViewPort.Set(0, 0, distance);
v3BottomLeft = Camera.main.ViewportToWorldPoint(v3ViewPort);
v3ViewPort.Set(0.75f, 0.75f, distance);
v3TopRight = Camera.main.ViewportToWorldPoint(v3ViewPort);
transform.localScale = new Vector3(v3BottomLeft.x - v3TopRight.x,
v3BottomLeft.y - v3TopRight.y, goDepth);
transform.Rotate(new Vector3(0,0,180));
}
just play around with the values until you find something that works for you
Your answer
![](https://koobas.hobune.stream/wayback/20220612135707im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Run signed apk 2 Answers
Why is my apk detected as a malicious file ? 0 Answers
Apk doesn't work 0 Answers
How do I build apk that works on galaxy s8 aspect ratio (18.5/9)? 0 Answers
problem with apk signing, now i cant even make debug build 0 Answers