Author Topic: Underline Transparency  (Read 243 times)

Arzola

  • Newbie
  • *
  • Posts: 2
Underline Transparency
« on: June 05, 2018, 01:15:54 PM »
Hello,

I've been using TMP for quite some time now, and just recently decided to build my own conversation and animation system with it, mostly given how outdated the regular text system is in comparison.

That said, I stumbled upon this little something while testing and wanted to know if I'm missing something regarding the alpha. Esentially, the fact that changing the color value of the character it is supposed to be linked to, does nothing to it:

[ Guests cannot view attachments ]

As you can see, the letters of the rest of the message have been successfully made transparent (as this animation reveals them gradually), but the underline of a part of it remains visible.

The way I'm handling the alpha over the TMP_Text element (after the end text has already been provided of course) is as follows:

[ Guests cannot view attachments ]

For context, animation progress is a value between 0 and 1 that denotes how opaque the item should be. Also (as this might be important), this method is never called when iterating over a tag character. Meaning, that if the text to fade is "<u><b>Hello World</b></u>", this method is only called for the "Hello World" (tagless) indexes.

So, if my intention is to make the underline share the same color and alpha properties as the text it should cover, what should I do?

Thank you, and have a nice day.

Stephan B.

  • Administrator
  • Hero Member
  • *****
  • Posts: 5651
Re: Underline Transparency
« Reply #1 on: June 05, 2018, 05:07:09 PM »
The Underline, StrikeThrough and Mark tag all use their own geometry which is added at the end of the geometry arrays.

Each underline segment is made up of 3 quads, start and end of fixed width and a middle section that stretches. A single underline segment can spawn multiple characters so controlling these on a per character basis will not be an easy thing to handle. Segments are used to minimize the geometry needed to display underline. The start and end with middle are also created to make it possible to have the Outline (material property) contour the segment to keep to visual appearance contiguous.

I am not certain how best to tackle this one.






Arzola

  • Newbie
  • *
  • Posts: 2
Re: Underline Transparency
« Reply #2 on: June 05, 2018, 06:25:53 PM »
Hello, and thank you for the reply.

How about this.

Let's assume that every time the animation will be fully applied to the whole underlined segment at once. Meaning, there won't be any need to worry about a per-character fade, as all of those underlined will always share the same properties. Or even, that the underlines themselves could be the last things to make transparent, or have animations of their own.

In this scenario where these are "independent", which snippet of code do I have to use to access and manually modify them? As I can't seem to find a way to reference them.