CancelFade

From ZDoom Wiki
Jump to navigation Jump to search

void CancelFade (void);

Usage

If either FadeTo or FadeRange is currently in progress, CancelFade stops it and turns off the palette flash. If neither of these in progress, it does nothing.

Examples

This alarm flashes the screen red and makes an alarm sound.

script 1 (void)
{
    AmbientSound("special/alarm",127);
    FadeTo(255, 0, 0, 0.9, 1.0); 
    Delay(1*35);
    FadeTo(255, 0, 0, 0.9, 1.0); 
    Delay(1*35);
}

The only way to shut it of is to hit a switch which executes script 2.

script 2 (void)
{
    ACS_Terminate(1,0);
    CancelFade();
}