new AnimatedCanvas(options)
Parameters:
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
options |
* |
Properties
|
||||||
option.density |
number | particule density, default .5 |
||||||
option.speed |
number | particule speed, default 4 |
||||||
option.angle |
number | particule angle in radian, default PI/4 |
||||||
options.animate |
boolean | start animation, default true |
||||||
options.fps |
number | frame per second, default 25 |
Extends
Methods
-
clear()
-
Clear canvas
-
draw(dt)
-
Draw canvas overlay (draw each particules)
Parameters:
Name Type Description dt
number timelapes since last call
-
getCanvas()
-
Get overlay canvas
Returns:
- Type
- CanvasElement
-
getParticules()
-
Create particules or return exiting ones
-
getVisible()
-
Get the visibility
Returns:
b
- Type
- boolean
-
randomCoord()
-
Get random coordinates on canvas
-
setAnimation(anim,)
-
Set canvas animation
Parameters:
Name Type Description anim,
boolean default true
-
setMap(map)
-
Set the map instance the overlay is associated with
Parameters:
Name Type Description map
ol.Map The map instance.
-
setVisible(b)
-
Set the visibility
Parameters:
Name Type Description b
boolean -
testExit(p, size)
-
Test if particule exit the canvas and add it on other side
Parameters:
Name Type Description p
* the point to test
size
ol.size size of the overlap
-
updatePixelPosition()
-
No update for this overlay
- Overrides:
- ol.Overlay#updatePixelPosition