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 1337GameDev · Jun 16, 2012 at 04:17 PM · androidguirotatecolor change

GuiText changing color based on what is behind it (if black it is white and etc) make it easy to read.

I am working on android and am curious on how to set up a textMesh or a GuiText object to have the font dynamically change color so it is easier to read based on the background color. I have a status bar that i want to move in back of the text and want the text easy to read while the progress bar moves. I posted a similar problem but wanted to explain a bit more. Here is similarly what i want:

Status Bar Color Change

I was told to try a TextMesh object, and then use a custom shader that just inverts the color, but when i do, the shader appears just as a purple box when i push to my android device. I also cannot get the textMesh centered over a guiTexture i have on screen. If i use screenToWorld point and give it my main camera, it appears in the center of the screen and does not follow on screen when i rotate my camera. How would i take into account these variables?

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 whydoidoit · Jun 16, 2012 at 04:21 PM 0
Share

Yeah I remember your least question. Just a thought for a different approach to make it legible - you could use a font that has an outline in Gold and black text - then it would be visible in both circumstances.

avatar image 1337GameDev · Jun 16, 2012 at 04:24 PM 0
Share

I want to avoid "hardcoding" this into my assets in case i add features or use some other color later. Right now i use a light blue and gold for my status bars but i am think of red and green for other builds as well. Any other ideas? I'm kinda stumped and the screenToWorld is annoying me half to death on how i get around the issue im having....

avatar image whydoidoit · Jun 16, 2012 at 04:35 PM 0
Share

There would be a way of making it fit other colours if you used a white outline and then adjusted its colour in the shader color setting, but I understand you wish to do something different. Am thinking - but then again I'm not much of a shader programmer :S

avatar image 1337GameDev · Jun 16, 2012 at 04:49 PM 0
Share

I could use a shader, but i am unsure of how to do that and if it'll work on android honeycomb on the galaxy tab 10.1

avatar image 1337GameDev · Jun 16, 2012 at 05:15 PM 0
Share

maybe if i could get the text's inner body to not be transparent and be black itd be alright (i can have a white outline and a black interior)

Show more comments

0 Replies

· Add your reply
  • Sort: 

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

How to scale different GUI objects to fit screen size ANDROID 1 Answer

Rotation on Android vs. PC 0 Answers

Using "fonts" that are actually images for a multi-outline effect. 2 Answers

GUI button doesn't appear on Android 0 Answers

Problem with Android Keyboard/TextField 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