Methods
(inner) setAmplitude(amplitude)
Set the Amplitude of the Wave motion of the Snowflakes
Parameters:
Name |
Type |
Description |
amplitude |
number
|
The Amplitude to set |
- Source:
-
(inner) setBackground(colour)
Set the background colour
Parameters:
Name |
Type |
Description |
colour |
string
|
The background colour of the Canvas
|
- Source:
-
(inner) setDensity(density)
Set the density of the Snowflakes. This is the number of snowflakes
on screen at a resolution of 1280 x 1080, but this number is scaled
up and down at higher and lower resolutions respectively to give a
consistent look when resizing. Setting this restarts the simulation.
Parameters:
Name |
Type |
Description |
density |
number
|
A number representing the density of snowflakes.
|
- Source:
-
(inner) setFade(value)
Should the snowflakes grow in size from nothing until they reach
their full size? It happens pretty quickly. Setting this restarts
the simulation.
Parameters:
Name |
Type |
Description |
value |
Boolean
|
Yes or no? |
- Source:
-
(inner) setFrequency(frequency)
Set the Frequency of the Wave motion of the Snowflakes.
Parameters:
Name |
Type |
Description |
frequency |
number
|
The frequency to set |
- Source:
-
(inner) setGravity(angle, strength)
Set the angle and strength of gravity in the simulation.
Parameters:
Name |
Type |
Description |
angle |
number
|
The angle of gravity, in degrees
|
strength |
number
|
The strength of the gravity |
- Source:
-
(inner) setPaused(pause)
Set this to true to prevent the update. Set it to true to continue
from where we left off.
Parameters:
Name |
Type |
Description |
pause |
boolean
|
If the simulation should be halted or not
|
- Source:
-
(inner) setPrimary(colour)
Sets the colour of the Snowflakes in the foreground
Parameters:
Name |
Type |
Description |
colour |
string
|
A Hex string representing the colour of the foreground snow.
|
- Source:
-
Should the snowflakes scroll up and down the page as the User
scrolls?
Parameters:
Name |
Type |
Description |
value |
Boolean
|
Yes or no? |
- Source:
-
(inner) setSecondary(colour)
Sets the colour of the Snowflakes in the background
Parameters:
Name |
Type |
Description |
colour |
string
|
A Hex string representing the colour of the background snow.
|
- Source:
-
(inner) setWind(angle, strength)
Set the angle and strength of the wind in the simulation.
Parameters:
Name |
Type |
Description |
angle |
number
|
The angle of the wind, in degrees
|
strength |
number
|
The strength of the wind |
- Source:
-
(inner) start(config)
Parameters:
Name |
Type |
Description |
config |
Object
|
A config, possibly from the Visual Config Editor.
Properties
Name |
Type |
Attributes |
Default |
Description |
bg |
string
|
<optional>
|
'#0d0014'
|
A hex string representing the Background Colour of the
canvas.
|
primary |
string
|
<optional>
|
'#8d90b7'
|
A hex string representing the colour of the snowflakes
in the foreground.
|
secondary |
string
|
<optional>
|
'#ffffff'
|
A hex string representing the colour of the snowflakes
in the background.
|
density |
number
|
<optional>
|
200
|
A number representing the required density of
snowflakes on screen. Note, this is not the actual
number of snowflakes.
|
fadeIn |
Boolean
|
<optional>
|
false
|
Should the snowflakes grow in size when the app starts
or should they begin at their full size?
|
scroll |
Boolean
|
<optional>
|
false
|
Should the snowflakes scroll when the user scrolls up
and down the page?
|
wave |
Object
|
|
|
Configure the wave motion of the snowflakes.
Properties
Name |
Type |
Attributes |
Default |
Description |
frequency |
number
|
<optional>
|
0.02
|
The frequency of the wave the snowflakes
follow.
|
amplitude |
number
|
<optional>
|
1.0
|
The amplitude of the wave the snowflakes
follow.
|
|
gravity |
Object
|
|
|
Configure the gravity of the simulation.
Properties
Name |
Type |
Attributes |
Default |
Description |
angle |
number
|
<optional>
|
90
|
The angle of gravity, in degrees.
|
strength |
number
|
<optional>
|
0.7
|
The strength of gravity.
|
|
wind |
Object
|
|
|
Configure the wind.
Properties
Name |
Type |
Attributes |
Default |
Description |
angle |
number
|
<optional>
|
0
|
The angle of the wind, in degrees.
|
strength |
number
|
<optional>
|
0
|
The strength of the wind.
|
|
|
- Source:
-
(inner) togglePaused()
Pause/unpause the snowfall update loop
- Source:
-