Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

Inline color vs Color property alpha

A topic by Scarlet String Studios created Mar 01, 2021 Views: 138 Replies: 4
Viewing posts 1 to 5
(1 edit)

I was setting up some UI text with STM, and I just remembered some strange behavior that I had noticed a while ago.

So — inline color is supposed to take priority over the component's color property, right? That makes sense. But, there are some situations where you'd want to control the text's alpha separately from its color, right? E.g. you might want to fade some UI text in and out, but it's impossible to fade any text that's wrapped with an inline color, because the inline color also defines an alpha value that takes priority.

Do you think you could solve this with some kind of "fade" slider that controls the alpha only? I've seen a similar behavior in some shaders, where the alpha is multiplied by a 0-1 float at the end (completely separate from the Tint property). As far as I can tell, I don't think it's possible for us to fix this from outside the STM source code, because I don't see other properties related to color in there.

Developer

That's a good idea! But before I implement it...

I'll be able to check myself in just a bit, but I think if you make a draw animation that fades, it'll work in the way you want. Does this workflow work for you?

Ah, I see what you mean. I think that wouldn't work in this case, because my use case right now is showing/hiding a menu. It's not a read/unread effect; I'm simply fading in all the text or Images for the menu - either manually via a coroutine or with an Animator - and then fading them out when you exit the menu. So, I don't think draw animations could be set up to work like that, unless I'm mistaken.

Developer

I've sent you an email with a build!

Developer

Oh yeah public update:

The patch worked! Fade will be added when I get around to publishing the next update.