create a spotlight div
| Name | Type | Description | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
optional
|
Members
-
the list of spotlights. if manually changed then call redraw() to update the canvas
Methods
-
circle (x, y, radius, noRedraw)Spotlight
-
adds a circle spotlight
Name Type Description xnumber ynumber radiusnumber noRedrawboolean optional don't force a canvas redraw
Returns:
Type Description Spotlight -
clear (noRedraw)Spotlight
-
clears any cutouts
Name Type Description noRedrawboolean optional don't force a canvas redraw
Returns:
Type Description Spotlight -
removes spotlight
-
fadeIn (options)Spotlight
-
fade in the under layer
Name Type Description options* optional Name Type Default Description startnumber 0 optional starting opacity
endnumber 1 optional ending opacity
durationnumber 1000 optional duration of fade in milliseconds
easestring | function 'easeInOutSine' optional easing function (@see https://www.npmjs.com/package/penner)
onEndfunction optional callback after fading
Returns:
Type Description Spotlight -
fadeOut (options)Spotlight
-
fade out the under layer
Name Type Description options* optional Name Type Default Description startnumber 1 optional starting opacity
endnumber 0 optional ending opacity
durationnumber 1000 optional duration of fade in milliseconds
easestring | function 'easeInOutSine' optional easing function (@see https://www.npmjs.com/package/penner)
onEndfunction optional callback after fading
Returns:
Type Description Spotlight -
hide ()Spotlight
-
hide spotlight
Returns:
Type Description Spotlight -
checks whether spotlight is visible
Returns:
Type Description boolean -
polygon (points, noRedraw)Spotlight
-
adds a polygon spotlight
Name Type Description pointsArray.<number> [x1, y1, x2, y2, ... xn, yn]
noRedrawboolean optional don't force a canvas redraw
Returns:
Type Description Spotlight -
rectangle (x, y, width, height, noRedraw)Spotlight
-
adds a rectangle spotlight
Name Type Description xnumber ynumber widthnumber heightnumber noRedrawboolean don't force a canvas redraw
Returns:
Type Description Spotlight -
redraw ()Spotlight
-
force a redraw of the spotlight (usually called internally)
Returns:
Type Description Spotlight -
resize ()Spotlight
-
resize the layer to ensure entire screen is covered; also calls redraw()
Returns:
Type Description Spotlight -
show ()Spotlight
-
show spotlight
Returns:
Type Description Spotlight