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
-2
Question by AnaRhisT · Jul 16, 2010 at 01:45 PM · textcolorguitext

Change MANUALLY GUIText's.text COLOR

I put a GUIText on a WHITE panel, the text isn't shown.. obviously(Default is white guitext's.text color)

I can see the text in runtime with this:

 guiText.material.color = Color.black;

The question is: How can I manually edit the Material's color?

*Another thing, in run-time the material slot isn't null, means there's a "font material" added to that slot, and in brackes instance. font material(instance)

When I go to that material in my project tab, the color is blocked, I can't access it..

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

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by Mike 3 · Jul 16, 2010 at 02:04 PM

Try create a new material, set the colour, then add the font texture from inside the font

You should be able to assign pretty much any transparent shader you want, though GUI Text or an unlit shader will work well

Comment
Add comment · Show 6 · 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 AnaRhisT · Jul 16, 2010 at 02:13 PM 0
Share
  1. Created a new material; 2. Set the color to black. 3. changed the material's shader to "GUI/Text Shader". 4.It's really black now, but the font looks too bad - not readable.

avatar image Mike 3 · Jul 16, 2010 at 02:20 PM 0
Share

$$anonymous$$ake sure both the font texture and the font used on the guitext match up, or else it'll look screwy

avatar image AnaRhisT · Jul 16, 2010 at 02:29 PM 0
Share

Ofcurse they match, but I managed to solve this a new shader which can't be found in Unity's assets folder. I'll answer on my question as a solution. Thank you anyways mike! goto mIRC :<

avatar image Mike 3 · Jul 16, 2010 at 02:36 PM 0
Share

Works fine for me with any transparent shader at all

avatar image AnaRhisT · Jul 16, 2010 at 05:46 PM 0
Share

I tried to use transparent shaders also, doesn't work..

Show more comments
avatar image
-1

Answer by AnaRhisT · Jul 16, 2010 at 02:30 PM

Solution:

Shader "GUI/Text Shader with Z test" { Properties { _MainTex ("Font Texture", 2D) = "white" {} _Color ("Text Color", Color) = (1,1,1,1) }

SubShader { Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" } Lighting Off Cull Off ZTest Always ZWrite Off Fog { Mode Off } Blend SrcAlpha OneMinusSrcAlpha Pass { ZTest LEqual Color [_Color] SetTexture [_MainTex] { combine primary, texture * primary } } } }

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

TextArea/Field - Individual Character's foreground and background color. 2 Answers

GameObject text colors in hierarchy panel 1 Answer

3D Text Object does not change to the color specified on Mouse Over 0 Answers

How to display EULA from Doc in Unity? 0 Answers

How to display Greek alphabets 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