• 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
0
Question by H4nsi_Kursch · Dec 22, 2014 at 07:04 PM · camera2d-gameortographicaspect

Game Resolution and Scaling Unity 2D

I'm currently testing Unity to use it as the engine for my next game. It's a 2D platform that will run on PC.

I'm really concern about multi resolution because it's been an issue before, and some other solutions like Cocos2d-x and XNA have really straightforward approaches to this.

I want the game to have the 16:9 aspect with default resolution being 1920x1080. I also want to keep the aspect, but make it possible to select different resolutions. It's not a problem if the game will have black bars on top and bottom of the screen when running in different aspects.

I've seen some topics about this for mobile games in Unity. I haven't seen many topics about my issue in particular (Is anybody else doing 2D PC games on Unity?).

I'm using ortographic camera, and so far I've been able to get the camera size 5.4 using the formula:

cameraSize = 1080 / 100.0f / 2.0f;

100.0f being the units per pixel value.

Can somebody give me some advice on how to get this to work? This is a really important issue and if I don't get it right, maybe I'll have to find another engine.

Thanks for your help!

Comment
Add comment
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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by tanoshimi · Dec 22, 2014 at 07:05 PM

Go Edit -> Project Settings -> Player. Under "Standalone Player Options", check 16:9 Supported Aspect Ratio, and uncheck all others. Then players will only be given option of supported 16:9 resolutions when starting the game.

Comment
Add comment · Show 2 · Share
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 H4nsi_Kursch · Dec 22, 2014 at 07:25 PM 0
Share

I don't want to use that window either. I want to give the options inside the game through an options menu.

I've done this before in XNA and it was not that hard.

avatar image tanoshimi · Dec 22, 2014 at 07:28 PM 0
Share

Please don't post additional information or comments as "answers". Edit your question, or add a comment.

Perhaps you're looking for http://wiki.unity3d.com/index.php?title=AspectRatioEnforcer ?

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.

Follow this Question

Answers Answers and Comments

2 People are following this question.

avatar image avatar image

Related Questions

Transition a camera from ortographic to perspective mode (Trombone effect) 2 Answers

Different Aspect ratios cuts off game 1 Answer

How to stretch camera to a rectangle? 1 Answer

DrawFrustum not the same as camera 1 Answer

Set camera aspect ratio and position 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