Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 Kthieu · Apr 17, 2014 at 04:57 AM · guibuttonsettingspressed

Unity GUI Button Options

I'm new to using Unity and I have a question about GUI.buttons. I know that these are one time events that do an action upon one click. My goal is to have a sort of settings for the game graphically using these buttons. However, I cannot think of a visual representation of this.

For example, say for a game, at the starting menu, I can choose to set bullets for something to be infinite or limited. There are two thus two buttons to graphically represent this. By default, the game settings have limited set to on; a bool that is set to true. Graphically, this would show as a button being pressed down and stays down. If I were to press the other button to set the amount of bullets to infinite, this button would graphically be shown as pressed down while the other is shown in a default non pressed button.

I'm looking through possible Unity options and it seems I cannot do this.

Another possibility I'm thinking is to using GUI.Button like normal, and when the button is pressed once, the color of the text on the button changes to signify that it has been chosen and the overall bool is true for the game. I believe this is possible but I need confirmation. Thanks.

Comment
Add comment · Show 1
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 robertbu · Apr 17, 2014 at 05:15 AM 0
Share
  • You can use GUI.Toggle() (though it is not a perfect match)

  • You can dynamically change the texture on a button based on state.

  • You can dynamically change the GUIStyle of a button

  • You can implement your buttons as GUITextures and use On$$anonymous$$ouseDown() to get the click.

  • You can implement your buttons as Quads and use Raycasting or On$$anonymous$$ouseDown() to get the click.

Note that NGUI and EZGUI make doing something like this far easier, but they cost $$. Apparently a new GUI system is in the works for Unity based on NGUI.

0 Replies

· Add your reply
  • Sort: 

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

20 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

Related Questions

3D Button? 1 Answer

Disable one GUI Button with my Mouse Scroll Wheel? 1 Answer

Unity android button and Time.timescale problems 1 Answer

How to give animation to the on gui button? 1 Answer

Help with GUI clicking ??? 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