Constructor






Methods




Fader:fadeIn(callback: function?, options: (table|"alpha"|"blocky"|"color"|"music"...(+1))?)

Fades the screen back in with the given options and based on the previous fade out.
A default fadein will fade the screen and music in over 0.25 seconds.


@param callback — A function that will be called when the fade has finished.

@param options — A table defining additional properties to control the fade.

options:
    | "speed" -- The speed to fade in at, in seconds (Defaults to last fadeOut's speed.)
    | "color" -- The color that should be faded to (Defaults to last fadeOut's color)
    | "alpha" -- The alpha to start at (Defaults to `1`)
    | "blocky" -- Whether to do a rough, 'blocky' fade. (Defaults to `false`)
    | "music" -- The speed to fade the music at, or whether to fade it at all (Defaults to fade speed)

Arguments:

callback: function?

A function that will be called when the fade has finished.

options: (table|"alpha"|"blocky"|"color"|"music"...(+1))?

A table defining additional properties to control the fade.



Fader:fadeOut(callback: function?, options: (table|"alpha"|"blocky"|"color"|"music"...(+1))?)

Starts a fade out with the given options.
A default fadeout will fade to black over 0.25 seconds, fading out the music as well.


@param callback — A function that will be called when the fade has finished.

@param options — A table defining additional properties to control the fade.

options:
    | "speed" -- The speed to fade out at, in seconds. (Defaults to `0.25`)
    | "color" -- The color that should be faded to (Defaults to `COLORS.black`)
    | "alpha" -- The alpha to start at (Defaults to `0`)
    | "blocky" -- Whether to do a rough, 'blocky' fade. (Defaults to `false`)
    | "music" -- The speed to fade the music at, or whether to fade it at all (Defaults to fade speed)

Arguments:

callback: function?

A function that will be called when the fade has finished.

options: (table|"alpha"|"blocky"|"color"|"music"...(+1))?

A table defining additional properties to control the fade.



Fader:parseMusicFade(to: number, options: table)

(Called internally) Processes music fading with the options table for fades.

@param to — The volume to fade the music to.

@param options — The table of options for the current fade.

Arguments:

to: number

The volume to fade the music to.

options: table

The table of options for the current fade.



Fader:parseOptions(options: table, reset_values: boolean)

(Called internally) Processes the options table for fades, setting values for the appropriate fields.

@param options — The table of options for the current fade.

@param reset_values — Whether to reset values from previous fades. (Usually true when fading out, and false when fading in)

Arguments:

options: table

The table of options for the current fade.

reset_values: boolean

Whether to reset values from previous fades. (Usually true when fading out, and false when fading in)

Returns:

1: table


Fader:transition(middle_callback: fun()?, end_callback: fun()?, options: (table|"alpha"|"blocky"|"color"|"music"...(+1))?)

Starts a transitional fade that runs callbacks at certain points in the fade progress

@param middle_callback — A function that runs at the instant the fade out finishes, before fading back in

@param end_callback — A function that runs when the fader has fully faded back in

@param options — A table defining additional properties to control the fade.

options:
    | "speed" -- The speed to fade out at, in seconds. (Defaults to `0.25`)
    | "color" -- The color that should be faded to (Defaults to `COLORS.black`)
    | "alpha" -- The alpha to start at (Defaults to `0`)
    | "blocky" -- Whether to do a rough, 'blocky' fade. (Defaults to `false`)
    | "music" -- The speed to fade the music at, or whether to fade it at all (Defaults to fade speed)

Arguments:

middle_callback: fun()?

A function that runs at the instant the fade out finishes, before fading back in

end_callback: fun()?

A function that runs when the fader has fully faded back in

options: (table|"alpha"|"blocky"|"color"|"music"...(+1))?

A table defining additional properties to control the fade.






Fields














Undocumented