Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 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
3
Question by tnetennba · Mar 18, 2011 at 03:57 PM · androidresolutionscreen

How do I set an Android applications resolution?

How do I set the resolution for a Unity Android application?

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

4 Replies

· Add your reply
  • Sort: 
avatar image
10

Answer by tnetennba · Mar 18, 2011 at 03:58 PM

You can set the resolution of your application by calling Screen.SetResolution which is documented here:

http://unity3d.com/support/documentation/ScriptReference/Screen.SetResolution.html

If you add this to a scripts start function and attach it to the Main Camera this will force the application to display full screen at a given resolution.

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
6

Answer by PawelSandra · Mar 21, 2015 at 06:35 PM

Here is what worked for me and although I am still learning Unity, this seems convenient:

I have set up my scene using canvas as per this tutorial: https://www.youtube.com/watch?v=sTJyJvHZZ1I

Then select Canvas in Hierarchy (instead of camera), then in the Inspector:

  1. Canvas > Render Mode > Screen space - Overlay

  2. Canvas Scaler (Script) > Ui Scale Mode > Scale with screen size

  3. Canvas Scaler (Script) > Reference Resolution > e.g. 800 x 600 (or whatever size works for you best)

I hope this helps somebody.

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 Lav-patel · Sep 19, 2012 at 07:52 AM

Void OnGUI() { GUI.matrix = Matrix4x4.TRS(Vector3.zero, Quaternion.identity, new Vector3(1.0f Screen.width / 1024, 1.0f Screen.height / 768, 1)); . . . . }

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 LilGames · Oct 26, 2021 at 07:10 PM

There is also DPI and resolution scaling to consider, as detailed here: https://docs.unity3d.com/2018.4/Documentation/Manual/class-PlayerSettingsAndroid.html and here: https://docs.unity3d.com/ScriptReference/QualitySettings-resolutionScalingFixedDPIFactor.html

I haven't quite figured it out yet, but those affect whether the device attempts to render to every pixel available (eg: every pixel availabe in a 4K screen) or scales up a lower-resolution buffer to the final screen output (eg: rendered to 1920x1080 then scaled to the screen display).

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

How can I support FHD+ Resolution in Android game? 0 Answers

Huawei P20 Pro Safe Area Issue 1 Answer

How to make my game fit into my droid? 1 Answer

Android screen Resolution 0 Answers

Android screen size - How to? 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