Fade

From Bennu Wiki
Revision as of 03:05, 2 October 2008 by Sandman (talk | contribs) (1 revision)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search


Definition

INT fade ( <INT red> , <INT green> , <INT blue> , <INT speed> )

Fades the screen from the current setting to the specified setting (red,green,blue) at the specified speed.

Parameters

INT red - Amount of red shown from 0 to 200. 100 is normal.
INT green - Amount of red shown from 0 to 200. 100 is normal.
INT blue - Amount of red shown from 0 to 200. 100 is normal.
INT speed - The speed of the fade from 1 to 64.

Returns

INT : true

Notes

Standard RGB combinations:

(R,G,B) - Description
(0,0,0) - Black out.
(100,100,100) - Normal.
(200,200,200) - White out.

The number of frames the fading will take can be calculated like this:

frames = roundup( 64 / speed )
speed = roundup( 64 / frames )

So:

Speed - Description
<0 - Takes 1 frame.
0 - Pointless.
1 - Takes 64 frames.
2 - Takes 32 frames.
3 - Takes 22 frames.
>=64 - Takes 1 frame.

See also fade_on() and fade_off().