env_fade

From Source Entities
Jump to navigation Jump to search

Code classes:

Env fade.png

env_fade is a point entity present in all Source games. It makes the screen fade to or from a solid color. Add Duration and Hold Time together for the total time this entity will be in effect.

ConVars/Commands[edit | edit source]

ConVar/CommandParameters or default valueParameter TypeEffect
fadeinfloat int int int 0Time (seconds), Red, Green, Blue, To do: ?Makes the screen black (or the specified color), then fades to the normal view. To do: Why is the last number required?
fadeoutfloat int int int 0Time (seconds), Red, Green, Blue, To do: ?Fades the screen to black (or the specified color). To do: Why is the last number required?

Flags[edit | edit source]

  • 1: Fade From - Screen fades from the specified color instead of to it.
  • 2: Modulate - Uses attenuation blending to achieve the fade. The normal fade does a straight weighted blend between the screen and the fading color. Modulate actually attenuates the RGB channels. For example, a color of 0 255 0 would mute the red and blue channels and create a green nightvision-type effect.
  • 4: Triggering player only (Not in FGD) - Only affects the screen of the !activator. !activator is probably the easiest to reach through a trigger entity. If not checked, the fade will apply to all players.
  • 8: Stay Out - Fade remains indefinitely until another fade deactivates it.

Keyvalues[edit | edit source]

Duration (seconds) (duration) <float>
The time that it will take to fade the screen in or out.
Hold Fade (seconds) (holdtime) <float>
The time to hold the faded in/out state.
Fade Alpha (renderamt) <integer>
Alpha of the fade, where 0 = fully transparent and 255 = fully opaque.
Fade Color (R G B) (rendercolor) <color255>
Fade color.
Reverse Fade Duration (seconds) (ReverseFadeDuration) <float> (available in all games since P2.png)
The duration of the fade when using FadeReverse.

Inputs[edit | edit source]

Fade
Starts the screen fade.
FadeReverse  (available in all games since P2.png)
Begins doing the reverse of the current fade.
Alpha (Not in FGD) <integer>
Changes Fade Alpha.
Color (Not in FGD) <color255>
Changes Fade Color.

Outputs[edit | edit source]

OnBeginFade
Fired when the fade has begun.