Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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
1
Question by Janjanus · Apr 05, 2016 at 01:30 PM · uitextshadowoutline

Fading a Text component with Shadow and Outline causes a problem

I am trying to fade a Unity UI Text component. Too this Text component I attached a Shadow and a Outline component to create the effect seen in the image below. But when changing the alpha of the color attribute from the Text component and the alpha of the effectColor attributes of the two effects the text becomes grayish as seen in the image. I am trying to achieve a more natural fade like the texts seen in the second row of the image.

I think the problem is caused by the Shadow an Outline component recalculating their shadow and outline based on the color attribute of the Text component they are attached too. But this fade is undesirable for me. Since I want to have the fade look like the texts seen in the second row of the image.

The only solution I see is to get some how a image of the Text component (with the shadow and outline effect applied) and fade this 'result' Image instead of the Text component.

Is it possible to receive a image (Bitmap) from a Text component and display this instead of the Text component it self? Or are there other (better) ways?

alt text

unity-ui-text.png (58.2 kB)
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 apcaskanette · Jun 30, 2016 at 03:44 PM 0
Share

Any luck on a solution? Having a similar problem in my current project.

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by apcaskanette · Jun 30, 2016 at 05:22 PM

I ended up doing a work around that fades the outline alpha faster than the text alpha.

     // Property
     public Outline textOutline; // dragged on via inspector
     
     // ...
     
     // Called during fade coroutine
     textOutline.effectColor = new Color(textOutline.effectColor.r, textOutline.effectColor.g, textOutline.effectColor.b, canvasGroup.alpha / 3);
 
 

Where the 3 is just some scaleout value, and the canvasgroup.alpha is the alpha of the text object (in my case it was in a canvasgroup).

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
-1

Answer by _eero_ · Sep 27, 2016 at 10:38 AM

You should create a Canvas Group for the text. The canvas group alpha setting applies on its child UI items as a whole so that you can fade the composition.

There is also a bug with adjusting only the Text component alpha when the text has an Outline component too. Changing the alpha forces the Outline component to rebuild meshes and causes gc allocations / garbage. By using a canvas group that can be avoided.

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 callen · Dec 16, 2016 at 03:23 PM 0
Share

That doesn't work. The faded out text still looks the same as a child of a canvas group as it does when editing the text's alpha directly.

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

7 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

UI Text - Stroke/Outline 1 Answer

Change UI outline/shadow via animation 0 Answers

Ui Effects components shadow and outline are creating tons of garbage 0 Answers

Text With No Fill, Just Outline 0 Answers

Font renders incorrectly 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