The DarknessRenderer component is used to render a darkness effect on the screen.
It supports a rectangular darkness mask with configurable width, height, color, opacity, and render layer.
This component works in conjunction with LightRenderer components in the scene - the darkness will block and be affected by any lights that intersect with it.

const darknessRenderer = new DarknessRenderer({
width: 100,
height: 50,
color: "#000000",
opacity: 0.5,
layer: "Default"
});

Constructors

Properties

Constructors

Properties

color: string = "#000000"

Darkness color

height: number = 0

Darkness height

layer: string = defaultRenderLayer

The render layer

opacity: number = 1

Darkness opacity between 0 and 1

width: number = 0

Darkness rectangle width