Version:

Screen Fader

Screen Fader

Controls fading the screen to a color and/or a texture. You can use this node to script cinematic transitions, such as fading to black or fading to a loading screen texture. The fade is a screen overlay that is rendered on top of the scene. The size and position of this overlay can be adjusted to a different size than full screen. This is useful if you want to draw letter boxes at the top and bottom of the screen. If you use custom positioning with a texture, you can use this node as a quick way to draw decorative borders around the frame.

To use the Screen Fader node in the Track View, see Screen Fader Node.

Topics

[screenfader, screenfadernode]

Example
In the following script, the screen first fades in, out, and then fades in again.

[Use the Screen Fader node to fade the screen in and out to black.]

Example
See the following screen fading in a game.

[Use the Screen Fader node to fade the screen.]

Inputs


PinTypeDescription
Fade OutEventTriggers fading out to a color or texture.
Fade InEventTriggers fading back in from a color or texture.
Fader IdNumberSpecifies which fader to use. This lets you maintain separate settings and/or layer fades on top of each other.
Fade In TimeNumberNumber of seconds when fading in.
Fade Out TimeNumberNumber of seconds when fading out.
ColorColorThe color to fade to and from. The alpha channel is ignored.The use of this property depends on the value of Use Current Color, and whether you are fading in or fading out.
Use Current ColorBooleanSpecify true to continue to use the current color for the fade overlay. The use of the Color property depends on the value of Use Current Color, and whether you are fading in or fading out. Current Color is the color that is rendered by the fader, including the alpha channel. This is generally whatever color is left over from prior fading activity. The Color Property Behavior table in the next section shows the color values that are blended to create the fading transition.
Texture NameString(Optional) The name of a texture from or to which to fade. To use only solid colors for fading, leave this value empty. For more information, see Finding the Texture Name.
Update AlwaysBooleanContinues fading even when the game is paused.
Screen CoordinatesVector4Sets the screen coordinates (left, top, right, and bottom) where the fade overlay is drawn. The default is full screen (0, 0, 1, 1).

Color Property Behavior

The following table shows the actual color values that are blended to cause the fading transition.

  • Fading – Refers to whether a fade-in or fade-out effect was triggered.
  • Use Current Color – The node’s Use Current Color input setting.
  • Start Color – The color used to render the overlay at the beginning of the transition.
  • Final Color – The color used at the end of the transition.
  • Color – The node’s Color input setting.
  • Current Color – The color that the fader actively renders, including the alpha channel. This is generally whatever color is left over from prior fading activity.
FadingUse Current Color InputStart ColorFinal Color
IntrueCurrent ColorCurrent Color with Alpha=0
InfalseColor input with Alpha=1Color input with Alpha=0
OuttrueCurrent ColorCurrent Color with Alpha=1
OutfalseColor input with Alpha=0Color input with Alpha=1

Outputs


PinTypeDescription
Fade Out CompleteEventSent when fade out is complete.
Fade In CompleteEventSent when fade in is complete.
Current ColorColorOutputs the current value for the fade overlay color.

Note
Most Script Canvas graphics features are available in Lua. However, ScreenFader is a single node in Script Canvas, and an EBus in Lua. For more information, see the ScreenFader EBuses.