FADEPALETTE

Top  Previous  Next

Syntax

INT = FADEPALETTE(toCol as UINT,time as UINT)

Description

Automatically Fades an 8 bit screen to the specified RGB color.

Parameters

toCol - RGB color to fade screen to.

time - Total time for fade operation to take.

Return value

None

Remarks

This function will only work with an 8 bit (palletized) screen mode. The time value is specified in 2/25th of a second (0.08).  So to specify 8 seconds the value would be 8/.08 = 100. Some common values are:

13 = about 1 second

25 = 2 seconds

50 = 4 seconds

100 = 8 seconds

Example usage

CREATESCREEN 640,480,8
SETPALETTECOLOR 2,RGB(255,0,0)
DO
    FILLSCREEN 2
    WRITETEXT 0,0,"Press ESC to fade and exit"
    FLIP
UNTIL KEYDOWN(1)
'4 second FADE to black. 0 = RGB(0,0,0).
FADEPALETTE 0,50
CLOSESCREEN
END