Illuminated.js Docs (v0.1)

A 2D lights and shadows rendering engine for your HTML5 web applications and games.
Show:

illuminated.DarkMask Class

Module: illuminated

Defines the dark layer which hides the dark area not illuminated by a set of lights.

Constructor

illuminated.DarkMask

(
  • [options]
)

Parameters:

  • [options] Object optional

    Options to be applied to this light.

    • [lights] Array optional

      An array of illuminated.Light objects that illuminate the rest of the scene.

    • [color] String optional

      The color of the dark area in RGBA format.

Item Index

Methods

Properties

Methods

compute

(
  • w
  • h
)

Compute the dark mask.

Parameters:

  • w Number

    Width of the canvas context.

  • h Number

    Height of the canvas context.

render

(
  • ctx
)

Draws the dark mask onto the given context.

Parameters:

  • ctx CanvasRenderingContext2D

    The canvas context on which to draw.

Properties

color

String

The color of the dark area in RGBA format.

Default: 'rgba(0,0,0,0.9)'

lights

Array

An array of illuminated.Light objects that illuminate the rest of the scene.

Default: []