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 DaveA · Apr 21, 2011 at 10:18 PM · windowguilayout

Can I put extra buttons on the title area of a GUILayout window?

I want to put some extra buttons on the 'title' are of a GUILayout.Window (like the 'system buttons' close, minimize, maximize, etc.) Can this be done?

I was able to put a simple button there, and clicking it highlights it like it's being pressed, but I don't get the fact that it was pressed. Is it legal, is there a better way to do it?

windowRect = ClampToScreen(GUILayout.Window (GetInstanceID(), windowRect, DisplayData, transform.name, GUILayout.MinWidth(600)));

// this would be a texture with style to look better, but to test, just a text X if (GUI.Button ( Rect (windowRect.x+5, windowRect.y+5, 45, 45), "X")) { Debug.Log("I'm clickin close"); // BUT I NEVER GET THIS MESSAGE }

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 DaveA · Apr 21, 2011 at 10:56 PM

Got it. I had this outside my 'draw' routine (DisplayData in my case) because I thought it best to get the final windowRect before placing buttons over it. But I can still do this inside that routine (with the rest of the content), and it works fine.

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 baranoob · Apr 02, 2015 at 06:11 PM 0
Share

Hi, can you explain more detail about how to do it? I could not find the ClampToScreen() method.

avatar image Graham-Dunnett ♦♦ · Apr 02, 2015 at 06:11 PM 0
Share

(You do know that you are asking someone who replied 3 years ago to give you more help)

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

GUI Window Render Priority 1 Answer

Margin not working on UILayout.BeginVertical("Window") 0 Answers

How do i bring one GUI window in front of another? 1 Answer

Having a GUILayout Window position immediately at screen center 5 Answers

GUILayout Window consume mouse events 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