GUI Text fading away or masking [solved]

My head is bursting finding no way.
I have lots of text, more than fits on the screen. Created with simple GUI.Box commands.
I can make it scroll no problem, but the problem is that the text should only be visible on half the screen. It should fade away in the bottom half.
Draw wise I could create a black rectangle in the lower half and cover the text with it, but since there are graphics in the BG it would look very dull to put a black rectangle there.
Is it somehow possible to blend the text away, add a mask, or something?

Programming wise speaking I am thinking of something like this:
GUI.Box(Rect(0,0,100,50),“Fade away”).alpha = X;
Where X is the fading factor.

But simply adding an alpha image that is used for the texts transparency below would be way better.

Is there a way to achieve that? :?

Do you mean kind of like I have the rolling high score list here fading in and out? That’s done by fading each line individually. I don’t think there’s any feasible way of masking GUI.X elements…I suppose you’d have to do that with shader trickery or rendertextures, neither of which work with GUI.X elements.

–Eric

Hehe, great work, that’s a funny game and very nice particle effects :slight_smile:
And yes, that’s a great effect. I could split the text in per lines and fade it away.
What’s the command to do that? Couldn’t find anything.

Change the .a value in GUI.color. Although in that particular case, I used 3D text so it was a matter of setting material.color.a.

–Eric

Ah cool, that works, thx. Here the code in case someone else stumbles upon it.
Set the alpha to transparent. Do the GUIs that should be faded, set it back to 1 for the following GUIs.

GUI.color.a = 0.1;
GUI.Box (Rect(10,245,100,20),"Fade");
GUI.color.a = 1;