Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • 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 RobertIvaldi · Feb 07, 2016 at 02:49 PM · cameraresolutionwindowisometricresizing

Change window size without changing game resolution?

I'm trying to keep a low game resolution as well as prevent scaling of rendered objects on the screen. My reason for this is mainly keeping the correct pixels-per-unit for meshes displayed while being window size independent.

If you have played any Chris Sawyer game, the UI and rendered scene resemble this behavior.

Window Size 1 alt text

Window Size 2 alt text

The black/red boxes represent GUI elements and the blue iso-cube represents a mesh. The resolution of the two are the same but the second has an obviously larger screen. The player has a larger view of what is happening but there is no unwanted scaling.

How would I go about implementing this in Unity with an isometric camera? Is this math I have to do on my part in code, or are there some means already in place for achieving this behavior?

smallres.png (2.5 kB)
largeres.png (3.3 kB)
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

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Teravisor · Feb 07, 2016 at 10:01 PM

For isometric view:

If you're using orthographic camera, I suggest saving

float proportion = camera.orthographicSize / Mathf.Min(Screen.width, Screen.height);
and then modify camera.orthographicSize so it saves same proportion when screen was resized
camera.orthographicSize = proportion * Mathf.Min(Screen.width, Screen.height);

There is, unfortunately, one thing I think is unfixable: during resize it will be scaled for a little time because camera's view is still scaled and Unity script only affects it on next frame.

For UI: I recommend using anchors. You can set them in RectTransform component of UI element. They tell system where base point is relative to screen size (for X 0 is left side of screen, 1 is right side of screen; for Y 0 is bottom, 1 is top). And then setting offset of UI elements for them to be in place you want.

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

Answer by Dibbie · Feb 07, 2016 at 10:01 PM

You may want to look into UI Anchoring (http://docs.unity3d.com/Manual/UIBasicLayout.html)

basically, that point in the middle of the UI (by default) is what affects how that element will look on different resolutions.

This video is also pretty helpful: https://youtu.be/svyDgYz5idg?t=507

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

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

45 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Why different resolutions makes the camera area change? 0 Answers

Handling different resolutions? 2 Answers

First Person Camera Pixelation 1 Answer

Camera horizontal distortion? 1 Answer

I would like to make an isometric camera in a racing game 3d someone could help me? 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