- Home /
4:3 aspect ratio
Hello,
I want to run a game in 4:3 mode always. On 16:10 and 16:9 screens the game is streched and from what I understand I can adjust the resolution from the camera view port settings. The problem is that on wide screens I get now the black stripes and the game is 4:3 centered, but the margins are cut. How can I reair this ?
I tried to read the resolution of the desktop and then change the game resolution to a 4:3 one ex.
rez=Screen.currentResolution.width + "x" + Screen.currentResolution.height;
////////// ///////// 4/3 resolution ///////// if(rez=="1024x768" || rez== "1280x1027" || rez=="1152x864" || rez=="1280x960" || rez=="1400x1050" || rez=="1600x1200" || rez=="2048x1536"){ Screen.SetResolution(1024, 768, true); }
////////// ///////// 16/9 resolution ///////// if(rez=="1280x720" || rez=="1365x768" || rez=="1600x900" || rez=="1920x1080" || rez=="1366x768" || rez=="1600x900"){ Screen.SetResolution (1280, 720, true); }
////////// ///////// 16/10 resolution ///////// if(rez=="1280x800" || rez=="1440x900" || rez=="1680x1050" || rez=="1920x1200" || rez=="2560x1600" || rez=="1280x768"){ Screen.SetResolution (1280, 800, true); }
I already tried this : http://www.unifycommunity.com/wiki/index.php?title=AspectRatioEnforcer and it doesn't work.
Thanks.
As I already mentioned, trying to check specific resolutions like that will never work. You can't cover them all, and it's very messy when you could just check the ratio ins$$anonymous$$d. As for AspectRatioEnforcer, "it doesn't work" is extremely vague. It works perfectly fine on any computer I've tested it on, and in fact it's unlikely it could ever fail. If you're using it and then trying to select a 4:3 resolution, that's not how it works. Just select a widescreen resolution as usual and then the game will be pillarboxed.