Class: MeteorShower

MeteorShower(ctx)

new MeteorShower(ctx)

MeteorShower.

Parameters:
Name Type Description
ctx CanvasRenderingContext2D | undefined

The context

Source:

Methods

clear() → {undefined}

Clear with the background color.

Source:
Returns:
Type
undefined

getRandColor() → {string}

Get a random color code for CSS.

Source:
Returns:

A RGB color code.

Type
string

getRandSpeed() → {string}

Get a random speed.

Source:
Returns:

A RGB color code.

Type
string

initialize() → {undefined}

Initialize a drawing property.

Source:
Returns:
Type
undefined

run() → {undefined}

Move the stars.

Source:
Returns:
Type
undefined

setBackcolor(backcolor) → {undefined}

Set the background color of canvas.

Parameters:
Name Type Description
backcolor number | string

A background color.

Source:
Returns:
Type
undefined

setCount(count) → {undefined}

Set count of meteors.

Parameters:
Name Type Description
count number

A count of meteor.

Source:
Returns:
Type
undefined

setHeight(height) → {undefined}

Set the height of canvas.

Parameters:
Name Type Description
height number

a canvas drawing height.

Source:
Returns:
Type
undefined

setWidth(width) → {undefined}

Set the width of canvas.

Parameters:
Name Type Description
width number

a canvas drawing width.

Source:
Returns:
Type
undefined

start() → {undefined}

Get start the shooting star.

Source:
Returns:
Type
undefined

stop() → {undefined}

Stop the star moving.

Source:
Returns:
Type
undefined