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 Ray-Pendergraph · May 28, 2010 at 12:55 PM · guimouseclickgroup

What does group content have to do with mouse clicks?

I was looking at using GUI groups and was looking through the documentation. I guess I had never noticed this before but for the content property, the docs say:

Text, image and tooltip for this group. If supplied, any mouse clicks are "captured" by the group and not If left out, no background is rendered, and mouse clicks are passed

My question is why does the presence of content dictate how mouse clicks are handled for the group (am I understanding this correctly)? Can any of the Unity guys explain the rationale behind this? That seems totally arbitrary to me. Wouldn't some sort of input handling strategy be better here, and potentially other parts of the API?

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 Molix · May 28, 2010 at 01:25 PM 1
Share

I just did some quick tests, and I can't see any difference with or without content in the group. I know you don't need content for other controls in the group to get clicks, but I had thought that content might capture clicks to overlapping controls, but that does not seem to be the case. Error in docs maybe? (there does seem to be an incomplete sentence in there).

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by qJake · Jun 08, 2010 at 10:07 PM

This behavior is because if your group has a background image attached to it, the click will "hit" the background, and register a click on it (so any controls underneath it won't get hit, since they aren't visible because of the background). However, if there is no background, the group's background becomes transparent, and any controls underneath are then visible, which need to be handled (since the user can see them), hence, the mouse clicks will "pass through" the transparent portions of the group.

Basically, it accounts for GUI objects behind the group. If you can see stuff underneath, it needs to be able to be clicked. :)

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 PrimeDerektive · Jan 21, 2011 at 02:01 PM

I'm pretty sure that's referring to the possibility of actually want to make the entire group clickable, by providing GUIContent you could in effect make the whole group a huge clickable button, or have a tooltip on hover (just like you would with any other GUI element by passing it GUIContent).

But it would have nothing to do with the clicks of any elements inside the group, they would handle their own clicks.

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

No one has followed this question yet.

Related Questions

How to group variables in the Inspector? 5 Answers

Disable mouse click navigation when selecting GUI menu option 1 Answer

How to cast spells by mouse click 2 Answers

GUI based character control 2 Answers

Create a sliding Menu 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