Hello,
I’m trying to understand how I can use SetTextOpacity on a text_block. Looking at the function:
Sets the opacity of the displayed text.
SetTextOpacity<native><public>(InOpacity:type {_X:float where 0.000000 <= _X, _X <= 1.000000}):void
Which I’ve been able to figure it is a type macro. I wanted to fade text in and out in a suspend function. It will accept a float directly, but if I put the same float in a varialbe, no luck. Any help would be greatly appreciated.
Cheers!
How you can put a variable as a text opacity:
if (Opacity := type{_X:float where 0.000000 <= _X, _X <= 1.000000}[OpacityFloat]): TextBlockChange.SetTextOpacity(Opacity)
Now you just need to figure out a function that modifies the number from 1.0 to 0.0.
I can imagine that being something like this:
for (OpacityInt := 0…100):
OpacityFloat := OpacityInt * 1.0 / 100.0
if (Opacity := type{_X:float where 0.000000 <= _X, _X <= 1.000000}[OpacityFloat]):
TextBlock.SetTextOpacity(Opacity)