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 sdgd · Jan 26, 2013 at 10:43 PM · c#labelglobalgui-windowbackside

how to make global labels in front and GUI.BringWindowToBack(ID);

     void OnGUI() {
         // 2 labels for screen X/Y detection for GUI elements
         GUI.Label(new Rect(0,0,100,20),Event.current.mousePosition.x.ToString());
         GUI.Label(new Rect(0,20,100,20),Event.current.mousePosition.y.ToString());
         // label for screen Y detection for input mouse position
         GUI.Label(new Rect(0,60,100,20),Input.mousePosition.y.ToString());
         
         WindowInventory = GUI.Window(InventoryID, WindowInventory, InventoryF, "Inventory", "Box");
         GUI.BringWindowToBack(1);
     }
     
     
     
     private void InventoryF (int id) {
         GUI.DragWindow(new Rect(0,0,WindowInventory.width,20));
     }


now this inventory window will stay in front of Global labels how do I bring that labels in front without giving another window?

why because I'm using global buttons to drag and drop in Equip and it's annoying if they are in back while they should be in front

from window to window

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

Answer by Bunny83 · Jan 27, 2013 at 03:25 AM

Windows are always drawn after the usual GUI stuff. So what you can do is put the other things also in a window then you can put one in front of another.

Another solution is to not use a window at all and draw your inventory before your "global labels". In this case, it you need the dragging functionality you have to implement this yourself, but it isn't too hard ;)

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 sdgd · Jan 27, 2013 at 03:55 AM 0
Share

yeah thought I'd need to make a window through whole screen

well I've already have the drag and drop buttons and verifying if it's on correct box in equip window when mouse released

but I thought there's an easier solution

thanks anyway

  1. cannot do with creating a new new window as items in world can't see if they have been pressed - void On$$anonymous$$ouseDown ()

OH crap if I make window through whole screen items can't see if I've mouse pressed them

even depth doesn't work I have 3 depths 0,1,2 (3 scripts) and witch ever window I click that one is in front

but if do it without all windows how am I going to tell witch one is in front of who?

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

10 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

Related Questions

How do you add graphics and features to a GUI Window? 1 Answer

dll cross platform? 2 Answers

java to c# 2 Answers

Error CS0016 in Unity? 0 Answers

How to make scripts independent from each other 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