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
1
Question by Donilias · Jul 02, 2011 at 12:13 PM · resolutionchangein-game

Change Game quality in-game

Hi everyone.

I'm using Unity 3.3 pro

I would like to make an option in my menu to change the resolution of the game, so you can choose; Fastest, Fast, Simple, Good, Beauthiful or Fantastic. I disabled the Auto input of Unity, because i want that option in my in-game. But how can i make that?

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

3 Replies

· Add your reply
  • Sort: 
avatar image
6
Best Answer

Answer by save · Jul 02, 2011 at 01:02 PM

It works fine, make sure that you close OnGUI too and also spell "beautiful".

Here's the corrected script:

 function OnGUI () {
     // Make a background box
     GUI.Box (Rect (10,10,200,1000), "Graphics Resolution");
 
     // Make the first button. If it is pressed, Application.Loadlevel (1) will be executed
     if (GUI.Button (Rect (20,40,80,20), "Fastest")) {
         QualitySettings.currentLevel = QualityLevel.Fastest;
     }
 
     // Make the second button.
     if (GUI.Button (Rect (20,70,80,20), "Fast")) {
         QualitySettings.currentLevel = QualityLevel.Fast;
     }
 
     // Make the second button.
     if (GUI.Button (Rect (20,100,80,20), "Simple")) {
         QualitySettings.currentLevel = QualityLevel.Simple;
     }
 
     // Make the second button.
     if (GUI.Button (Rect (20,130,80,20), "Good")) {
         QualitySettings.currentLevel = QualityLevel.Good;
     }
 
     // Make the second button.
     if (GUI.Button (Rect (20,160,80,20), "Beautiful")) {
         QualitySettings.currentLevel = QualityLevel.Beautiful;
     }
 
     // Make the second button.
     if (GUI.Button (Rect (20,190,80,20), "Fantastic")) {
         QualitySettings.currentLevel = QualityLevel.Fantastic;
     }
 }
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
1

Answer by Waz · Jul 02, 2011 at 12:19 PM

Use GUI functions (eg. HorizontalSlider), to get the user's choice, then just set QualitySettings.currentLevel

To change Resolution, offer the user the options from Screen.resolutions that suit your game, then set the selected one using Screen.SetResolution

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 Donilias · Jul 02, 2011 at 12:39 PM 0
Share

Sorry, but I won't the HorizonSlider but i want Buttons.

avatar image save · Jul 02, 2011 at 12:45 PM 2
Share

The same basics still apply, create a couple of buttons and set different QualitySettings.currentLevel and Screen.SetResolution depending on which one gets pressed.

avatar image Waz · Jul 02, 2011 at 09:12 PM 1
Share

Some prefer to be spoon-fed, sadly.

avatar image save · Jul 04, 2011 at 08:47 AM 0
Share

Very true Warwick, +1 on your answer as it probably were your answer who actually helped @Donilias in the first place.

avatar image
0

Answer by Donilias · Jul 02, 2011 at 12:57 PM

Sorry that i write this as an answer. But this is the script i have now. I don't know what i did wrong.

 function OnGUI () {
 
 GUI.Box (Rect (10,10,200,1000), "Graphics Resolution");

 
 if (GUI.Button (Rect (20,40,80,20), "Fastest")) {
     QualitySettings.currentLevel = QualityLevel.Fastest;
 }

 // Make the second button.
 if (GUI.Button (Rect (20,70,80,20), "Fast")) {
     QualitySettings.currentLevel = QualityLevel.Fast;
 }
 
 // Make the second button.
 if (GUI.Button (Rect (20,100,80,20), "Simple")) {
     QualitySettings.currentLevel = QualityLevel.Simple;
 }
 
 // Make the second button.
 if (GUI.Button (Rect (20,130,80,20), "Good")) {
     QualitySettings.currentLevel = QualityLevel.Good;
 }
 
 // Make the second button.
 if (GUI.Button (Rect (20,160,80,20), "Beauthiful")) {
     QualitySettings.currentLevel = QualityLevel.Beauthiful;
 }
 
 // Make the second button.
 if (GUI.Button (Rect (20,190,80,20), "Fantastic")) {
     QualitySettings.currentLevel = QualityLevel.Fantastic;

}

Can someone help me?

Comment
Add comment · Show 3 · 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 coliam · Nov 10, 2013 at 05:52 AM 0
Share

Just attach it to a camera, It should work fine.

avatar image TheGeekyDead · Apr 26, 2014 at 03:58 PM 0
Share

@coliam Actually it works even on the FPC lol, i tested it out so i integrated it into my project, just a modified version.

@Donilias "Sorry that i write this as an answer. But this is the script i have now. I don't know what i did wrong."

It would help to if you include the "Error" you receive, so people can help you better ;)

avatar image $$anonymous$$ · Jul 19, 2015 at 04:27 PM 0
Share

You spelled Beautiful wrong! You spelled it like Beauthiful!

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

9 People are following this question.

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

Related Questions

Can I customize the resolution window that appears at the start of my executable? 2 Answers

Changing screen resolution is cutting the very edge of my screen off 1 Answer

iPhone 4 and 5 resolution 1 Answer

How to use Float as Name in GameObject.Find command? 1 Answer

How to call Screen.SetResolution() only once before the first scene starts loading ? 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