Game Development Community

Fade a Bitmap

by Fredrik Sparf · in Torque Game Engine · 04/15/2004 (1:44 am) · 2 replies

Is there a way to get GuiFadeinBitmapCtrl to fade from transparent instead of black? Or is there another Control?

Transparent to Bitmap to Transparent.

/Fredrik

#1
04/15/2004 (2:51 am)
Look in guiFadeinBitmapCtrl.cc

find
ColorI color(0,0,0,alpha);
cut it and move it above this line (and under the { )

Parent::onRender(offset, updateRect);


Now to fix the blackness
find
dglDrawRectFill(offset, mBounds.extent + offset, color);
and comment it out.

Compile. and now your bitmap will fade.
#2
04/15/2004 (5:38 am)
Thanks for the quick response.

I didn't get it to work.

The bitmap is still showing but it doesn't fade at all now.

I think that dglDrawRectFill() fills the rectangle, containing my bitmap, with black color with different amount of alpha. So this funtion actually fades a color infront of my bitmap. I need to fade the bitmap itself.