Fade in and out roundedbox

How would i make a roundedbox slowly fade in and out? Thanks

Aren’t you asking too much stuff?

Erm how am i? I am asking for help…

Make the Alpha of the rounded box a function of time.

[editline]2nd November 2015[/editline]

Then make it so the draw function for your rounded box is enclosed in an if statement of whether the calculated alpha is more than zero or not.

Seraching up google, i found some i might be able to use.



				local startVal = 171;
				local endVal = 255;
				local speed = 5;
				local value = 0;
				
				value = value + speed * FrameTime( );
				
				value = math.Clamp( value, startVal, endVal )


So in short, you want to have your alpha be a localized variable based on a function of time going between 0 and 255, and you want it to be outside of the if statement where you decide whether or not the rectangle should be drawn at all. Then you use the same localized variable in your draw function to determine the alpha.

[editline]2nd November 2015[/editline]

Yeah that works kinda.

Im gonna go ahead and try it now. :slight_smile: Thanks

Can you set the alpha of a derma element without using a custom paint function?

I think it’s fairly easy if you just paint over it in most cases, I don’t remember about this one in particular but it’s definitely possible in all cases.