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 JoshOClock · Jan 17, 2011 at 05:12 PM · guitextsorting

How to force GUIText sorting?

I'm drawing black text under white text to get a bit of a dropshadow and outline.

On my PC this works fine, on my Mac it works fine. But if I build to my iPad the black text shows on top of the white text.

I've even gone as far as putting a script in both where in the OnGUI() call I set their transform.position.z every update to try and force the black 'shadow' text to be behind the white text. The Z difference is only 1 unit, maybe that's not enough?

The black text is a child to the white text, basically so I can use a script to get the parent and copy the text.

Any other suggestions?

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 Eric5h5 · Jan 17, 2011 at 06:36 PM 0
Share

OnGUI and transform.position.z don't mix. OnGUI functions don't use transform.position, and GUIText objects don't use OnGUI.

2 Replies

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

Answer by JoshOClock · Jan 20, 2011 at 08:59 PM

In the end it turned out that I needed to remove the parent/child relationship. Once I did that I was able to set the Z in the transform.position to a different value and it directly effects the Z ordering.

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 Jessy · Jan 17, 2011 at 05:30 PM

Change the render queue of the white text to come after the black text.

Also, you can change both shaders to use ZTest Always, use Offset, or do a few other tricks to render them in the same plane, if you want to. There's no way to predictably batch these things, so you might as well do that, unless the 3D positioning helps you visualize.

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

Place GUI Text Under 2D Sprite 0 Answers

Sorting an Arraylist filled with structs. 2 Answers

Sort Array Of GameoObjects useing a variable 1 Answer

Particles not rendering on sorting layer specified with sprite-default shader 0 Answers

The best way to sort list of gameobjects in order I need? 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