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 AtomicMarine · Jun 20, 2012 at 10:21 PM · guiguitextureonguicurser

GUI Problems

How can I place my GUIButtons drawn with the OnGUI function, behind some GUI Textures in my Scene, this is very frustrating as I have my mouse set to a GUITexture as a custom cursor and it appears behind my buttons despite having a very high Z axis Value Thanks Guys

Comment
Add comment · Show 6
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 hijinxbassist · Jun 20, 2012 at 10:25 PM 0
Share

You can try lowering the GUI.depth in the OnGUI(). $$anonymous$$ake sure to store the org value so you can set the depth back to what it was previous if you need other gui to render how it was(possibly in front of other gui)

 var depth=GUI.depth;
 GUI.depth=0;
 //All gui stuff
 GUI.depth=depth;
avatar image AtomicMarine · Jun 20, 2012 at 10:27 PM 0
Share

Will this make the GUI Drop down behind other things? if so this is perfect, and can Depth be negative?

avatar image hijinxbassist · Jun 20, 2012 at 10:29 PM 0
Share

i accidently said to raise it, what i meant is lower it :P. Im not sure if it can be negative, i think 0 is the lowest it goes..you can try i guess...but im pretty sure 0 is the lowest

avatar image hijinxbassist · Jun 20, 2012 at 10:33 PM 0
Share

Thats how ive done my custom cursors as well @tomekkie2 ,indeed works well

avatar image AtomicMarine · Jun 20, 2012 at 10:35 PM 0
Share

This did not solve my problem the depth only affects other on GUI objects not in scene GUITextures

Show more comments

1 Reply

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

Answer by tomekkie2 · Jun 20, 2012 at 10:31 PM

Use GUI.DrawTexture for custom cursor and use it at the very end of OnGUI function, after all buttons have been drawn, and that will appears on top. You can place the texture at:

 Input.mousePosition.x - Texture.width/2, Screen.height - Input.mousePosition.y - Texture.height/2
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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

GUI.DrawTexture on GUI.Button press 1 Answer

GUI.Box not showing Texture on device 1 Answer

How do I customize or reshape GUI vertical slider? 0 Answers

Reduce Draw call for Multiple GUI Textures with same Texture 1 Answer

Animated GUITexture based on Sprite Sheet? 0 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