Hello, Defold! Does anybody know how to set text opacity in label component at runtime? Is it possible?
What I’ve found here is not suitable for case of runtime or I always may missed something…
You should be able to add a tint to the label material just like for sprites and modify the tint run-time to change the font color (or opacity). Like this: https://gist.github.com/britzl/9880dad39b0d01fa0c908927320dd6d1
1 Like
@britzl , the github example offered here says it’s deprecated. It now looks like you change a label’s alpha like this:
go.set(url, "color.w", 0)
go.set(url, "outline.w", 0)
go.set(url, "shadow.w", 0)
…where ‘url’ points to the label.
Is this correct?
Yep, that’s correct.
1 Like