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
0
Question by Dogg · Aug 16, 2014 at 12:15 AM · resolutionscreensize

Which Is The Actual Game?(Max or no Max Screen)

This is a ignorant question and might seem confusing to many, but what screen is the actual game(meaning which one will you see on the actual device's screen). I have my screen/game window set to Ipad Wide (1024x768). When I click maximize on play, the textures for the main menu become bigger to where they're bigger than the title, and when I don't click maximize on play they stay the same size as when viewing in small screen. So which one will I see on a Ipad Wide 1024x768? Or which one is right? Hope you guys understand me, and sorry again for the ignorant question.

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
Best Answer

Answer by Kossuranta · Aug 16, 2014 at 02:28 AM

It won't scale anything bigger than resolution you have set, but when it uses lower resolution there should be text "Using resolution x" on top left corner of the Game screen.

Basically GameObjects will scale on resolution changes, but GUI won't if not set. This will be problem if you try to run your game on different resolutions (on bigger resolutions GUI will be small and on small resolutions GUI will be big).

Here is a good script for scaling GUI from SilverTabby in JavaScript:

 var native_width : float = 1920;
 var native_height : float = 1080;
  
 function OnGUI ()
 {
     //set up scaling
     var rx : float = Screen.width / native_width;
     var ry : float = Screen.height / native_height;
     GUI.matrix = Matrix4x4.TRS (Vector3(0, 0, 0), Quaternion.identity, Vector3 (rx, ry, 1)); 
  
     //now create your GUI normally, as if you were in your native resolution
     //The GUI.matrix will scale everything automatically.
  
     //example
     GUI.Box(  Rect(810, 490, 300, 100)  , "Hello World!");
  
 }

http://answers.unity3d.com/questions/169056/bulletproof-way-to-do-resolution-independant-gui-s.html

And my translation to C#: float native_width = 720; float native_height = 1280;

 void OnGUI()
 {
     float rx = Screen.width / native_width;
     float ry = Screen.height / native_height;
     GUI.matrix = Matrix4x4.TRS (new Vector3(0f, 0f, 0f), Quaternion.identity, new Vector3(rx, ry, 1f));
     GUI.Box(new Rect(810, 490, 300, 100), "Hello World!");
 }
Comment
Add comment · Show 4 · 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 Dogg · Aug 16, 2014 at 02:37 AM 0
Share

Ah so that's why some of my GUI went to the side. By the way, do you have that script in C#? I don't do Java.

avatar image Dogg · Aug 18, 2014 at 07:13 AM 0
Share

Never $$anonymous$$d, I'm just sticking with what I got for now. After all, my game is simple as can be.

avatar image Kossuranta · Aug 18, 2014 at 02:31 PM 0
Share

Edited my post and added also C# version of the code.

avatar image Dogg · Aug 19, 2014 at 01:26 AM 0
Share

Thanks a bunch. Although GUI $$anonymous$$atrix does seem a little too advanced.

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

23 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

Related Questions

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

iPhone Screen Size 2 Answers

how I can change the screen resolution in real time? 1 Answer

Forcing an resolution for all android and iphone screens 1 Answer

Position GameObject to Bottom Left Corner 2 Answers


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