Env fade: Difference between revisions
Jump to navigation
Jump to search
Bug:Due to a mistake in the code, the alpha value isn't read properly from these commands; if you specify rgb it also has to be specified for the fade to work.
m (Tabs) |
No edit summary |
||
Line 12: | Line 12: | ||
__TOC__ | __TOC__ | ||
==Keyvalues== | ==Keyvalues== | ||
{{KV Targetname}} | |||
{{KV|Duration (seconds) |intn=duration|string|The time that it will take to fade the screen in or out.}} | {{KV|Duration (seconds) |intn=duration|string|The time that it will take to fade the screen in or out.}} | ||
{{KV|Hold Fade (seconds) |intn=holdtime|string|The time to hold the faded in/out state.}} | {{KV|Hold Fade (seconds) |intn=holdtime|string|The time to hold the faded in/out state.}} | ||
Line 22: | Line 23: | ||
{{fl|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 <code>0 255 0</code> would mute the red and blue channels and create a green nightvision-type effect.}} | {{fl|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 <code>0 255 0</code> would mute the red and blue channels and create a green nightvision-type effect.}} | ||
{{fl|4|nofgd=1|Triggering player only| Only affects the screen of the {{ent|!activator}}. <code>!activator</code> is probably the easiest to reach through a [[trigger]] entity. If not checked, the fade will apply to all players.}} | {{fl|4|nofgd=1|Triggering player only| Only affects the screen of the {{ent|!activator}}. <code>!activator</code> is probably the easiest to reach through a [[trigger]] entity. If not checked, the fade will apply to all players.}} | ||
{{fl|8|Stay Out|Fade remains indefinitely until another fade deactivates it.{{Bug|{{tf2}}Fades applied to {{ent|!activator}} only that are also set to <Code>Stay Out</code> will not be deactivated by a new fade!}}}} | {{fl|8|Stay Out|Fade remains indefinitely until another fade deactivates it.{{Bug|tested={{tf2}}|Fades applied to {{ent|!activator}} only that are also set to <Code>Stay Out</code> will not be deactivated by a new fade!}}}} | ||
:{{todo|Test in other games, test if the <code>ScreenFade</code> VScript function is also affected}} | :{{todo|Test in other games, test if the <code>ScreenFade</code> VScript function is also affected}} | ||
==Inputs== | ==Inputs== | ||
{{ | {{I|Fade|Start the screen fade.}} | ||
{{ | {{I|FadeReverse|Begin doing the reverse of the current fade.|since=P2}} | ||
{{ | {{I|Alpha|nofgd=1|Changes '''Fade Alpha'''.}} | ||
{{ | {{I|Color|nofgd=1|Changes '''Fade Color'''.}} | ||
== Outputs == | == Outputs == | ||
{{ | {{O|OnBeginFade|Fired when the fade has begun.}} | ||
== ConCommands == | == ConCommands == | ||
Line 39: | Line 40: | ||
{{varcom|fadeout|float int int int int|Time (seconds), Red, Green, Blue, Alpha|Fades the screen to black (or the specified color).}} | {{varcom|fadeout|float int int int int|Time (seconds), Red, Green, Blue, Alpha|Fades the screen to black (or the specified color).}} | ||
{{varcom|end}} | {{varcom|end}} | ||
{{bug|Due to a mistake in the code, the alpha value isn't read properly from these commands; if you specify rgb it also has to be specified for the fade to work.}} | {{bug|hidetested=1|Due to a mistake in the code, the alpha value isn't read properly from these commands; if you specify rgb it also has to be specified for the fade to work.}} | ||
[[Category:GUI Entities]] | [[Category:GUI Entities]] |
Revision as of 05:48, 29 September 2024

This article needs more
links to other articles to help
integrate it into the encyclopedia. Please help improve this article by adding links
that are relevant to the context within the existing text.
January 2024



January 2024

![]() |
---|
CEnvFade |
![]() |
env_fade
is a point entity available in all Source games.
It controls screen fades to or from a solid color. Add Duration and Hold Time together for the total time this entity will be in effect.
Keyvalues
- Name (targetname) <string>[ Edit ]
- The name that other entities refer to this entity by, via Inputs/Outputs or other keyvalues (e.g.
parentname
ortarget
).
Also displayed in Hammer's 2D views and Entity Report.See also: Generic Keyvalues, Inputs and Outputs available to all entities
- Duration (seconds) (duration) <string>
- The time that it will take to fade the screen in or out.
- Hold Fade (seconds) (holdtime) <string>
- 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> (in all games since
)
- The duration of the reverse fade.
Flags
- Fade From : [1]
- Screen fades from the specified color instead of to it.
- Modulate : [2]
- 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.
- Triggering player only : [4] !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.
- Stay Out : [8]
- Fade remains indefinitely until another fade deactivates it.
Bug:Fades applied to !activator only that are also set to
Stay Out
will not be deactivated by a new fade! (tested in:)
- Todo: Test in other games, test if the
ScreenFade
VScript function is also affected
Inputs
- Fade
- Start the screen fade.
- FadeReverse (in all games since
)
- Begin doing the reverse of the current fade.
- Alpha !FGD
- Changes Fade Alpha.
- Color !FGD
- Changes Fade Color.
Outputs
- OnBeginFade
- Fired when the fade has begun.
ConCommands
Cvar/Command | Parameters or default value | Descriptor | Effect |
---|---|---|---|
fadein | float int int int int | Time (seconds), Red, Green, Blue, Alpha | Makes the screen black (or the specified color), then fades to the normal view. |
fadeout | float int int int int | Time (seconds), Red, Green, Blue, Alpha | Fades the screen to black (or the specified color). |
