There is a fixed function effect named "Improved Overlay", it does exactly what you want. But I can´t deliver it at the moment, because I´m not at my PC. And the gamestudio wiki is down since a few weeks.

Maybe someone else can paste the code?


no science involved