Garry's Mod Wiki

Player:ScreenFade

Player:ScreenFade

Player:ScreenFade( number flags, number clr = color_white, number fadeTime, number fadeHold )

Description

Fades the screen

Arguments

1 number flags
Fade flags defined with Enums/SCREENFADE.
2 number clr = color_white
The color of the screenfade
3 number fadeTime
Fade(in/out) effect transition time ( From no fade to full fade and vice versa ).

This is limited to 7 bits integer part and 9 bits fractional part.

4 number fadeHold
Fade effect hold time.

This is limited to 7 bits integer part and 9 bits fractional part.

Example

Flashes the screen red to nothing over 0.3 seconds when a player gets hurt.

hook.Add( "PlayerHurt", "hurt_effect_fade", function( ply ) ply:ScreenFade( SCREENFADE.IN, Color( 255, 0, 0, 128 ), 0.3, 0 ) end )

Special Pages


Wikis

?

Render Time: 49ms

DB GetPage 29
Generate Html 5
SaveChanges (1) 6
Render Body 0
Render Sidebar 7