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
3
Question by Yanger_xy · Mar 28, 2011 at 04:12 PM · guinormalstateguistyle

What's the difference between Normal and OnNormal in GUIStyle

Hello, everyone! I am confused about the difference between Normal and OnNormal and others like Hover and OnHover etc in GUIStyle, especially the OnNormal state, i do not know when i works. Just take the Normal and OnNormal as an example, The official document says:"Background image & Text Color of the Control in enabled state". I am not very clear about this statement. Does it mean the OnNormal works just at the moment when its state changed form disabled to enabled? Any reply will be appreciated!

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 yoyo · Dec 11, 2013 at 01:32 AM 0
Share

If you look at the GUIStyle.Draw method, some of the overloads take a "bool on" parameter. If true, then the "on" version of the styling will be used.

2 Replies

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

Answer by Owen-Reynolds · Mar 28, 2011 at 08:14 PM

The "ON" settings are for a Toggle which has been clicked into the ON state. For example, OnNormal is after you've clicked it ON and moved the mouse away.

Regular buttons, textfields... don't seem to use any of the "On" family.

Comment
Add comment · Show 1 · 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 Yanger_xy · Mar 29, 2011 at 02:52 AM 0
Share

Thank you very much.

avatar image
-1

Answer by Jason B · Mar 29, 2011 at 12:52 AM

Typically putting "On" before something indicates that something will fire the FIRST time that action occurs. So OnHover would occur on the frame your mouse begins to hover, but not subsequently. And Hover would be what occurs as your mouse continues to hover over some period of time.

Logically, this means that if you have a button with an OnHover color of blue, and a Hover color of green, moving your mouse over it will cause it to turn blue for a fraction of a second, and then it will be green until you take your mouse off.

Likewise, OnNormal would occur when the GUI object becomes normal, and Normal would be what occurs while time is passing and it is normal.

If that all makes sense.

Honestly there's no purpose I can discern from having OnNormal and OnHover etc. as part of the style, though it could be useful to route those happenings through scripts to make fancy GUI effects (like telling a button it can slowly begin glowing brighter OnHover, and OnNormal it can slowly fade back to normal).

Comment
Add comment · Show 2 · 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 Yanger_xy · Mar 29, 2011 at 02:41 AM 0
Share

Thanks for your reply. I do not know have i realized your opinion, OnNormal just take a fraction of a second even that we can not aware of its change? I tested it in my scene, and could not find the effect of OnNormal. Is it too fast? And are there any method or some codes that can demonstrate OnNormal's effect? Thanks.

avatar image Yanger_xy · Mar 29, 2011 at 02:51 AM 0
Share

Hi, i am clear now, just as Owen Reynolds said above, Regular buttons, textfields... don't seem to use any of the "On" family, The "ON" settings are for a Toggle.

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

1 Person is following this question.

avatar image

Related Questions

Access custom style from skin via string 1 Answer

Understanding GUISkin/GUIStyle BackgroundImage and Border 2 Answers

Background of GUI.TextField disappears when using a GUIStyle 2 Answers

Optimizing OnGUI - Too many gui elements? 2 Answers

Changing a GUIStyle for a button from Java Script to C# 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