• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
Question by radhoo · Apr 05, 2011 at 06:40 AM · cameraresolutionscreenaspect-ratio

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.

Comment
dpk

People who like this

1 Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Eric5h5 · Apr 05, 2011 at 08:51 AM 0
Share

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 instead. 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.

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

No one has followed this question yet.

Related Questions

Make camera have a fixed screen size 1 Answer

How to adjust desired camera size for all aspect ratios without having black edges? 0 Answers

Screen stretch 0 Answers

Orthographic cameras and screen resolutions 1 Answer

How to make game fit all screen Size and Resolutions 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges