PointSource

PointSource

A helper class used by the Sight Layer to represent a source of vision or illumination.

Constructor

new PointSource()

Source:

Members

(static) GEOMETRY :PIXI.Geometry

Source:

The default Geometry stored in the GPU for all Point Source meshes.

Type:
  • PIXI.Geometry

_animateSeed :number|null

Source:

An integer seed which de-synchronizes otherwise similar animations

Type:
  • number | null

_animateTime :number

Source:

Internal flag for animation throttling time

Type:
  • number

active :boolean

Source:

A flag for whether this source is currently active (rendered) or not

Type:
  • boolean

coloration :PIXI.Container

Source:

This visible color container for this source

Type:
  • PIXI.Container

darkness :boolean

Source:

Internal flag for whether this is a darkness source

Type:
  • boolean

illumination :PIXI.Container

Source:

The light or darkness container for this source

Type:
  • PIXI.Container

limited :boolean

Source:

Is the light source limited by an angle of emission?

Type:
  • boolean

radius :number

Source:

The maximum radius of emission for this source

Type:
  • number

Methods

animate(dt)

Source:

Animate the PointSource, if an animation is enabled and if it currently has rendered containers.

Parameters:
Name Type Description
dt number

Delta time

animatePulse(dt, speed, intensity)

Source:

A basic "pulse" animation which expands and contracts.

Parameters:
Name Type Description
dt number

Delta time

speed number

The animation speed, from 1 to 10

intensity number

The animation intensity, from 1 to 10

animateTime(dt, speed, intensity)

Source:

Emanate waves of light from the source origin point

Parameters:
Name Type Description
dt number

Delta time

speed number

The animation speed, from 1 to 10

intensity number

The animation intensity, from 1 to 10

animateTorch(dt, speed, intensity)

Source:

A torch animation where the luminosity and coloration decays each frame and is revitalized by flashes

Parameters:
Name Type Description
dt number

Delta time

speed number

The animation speed, from 1 to 10

intensity number

The animation intensity, from 1 to 10

drawColor() → {PIXI.Container}

Source:

Draw and return a container used to depict the visible color tint of the light source on the LightingLayer

Returns:

An updated color container for the source

Type
PIXI.Container

drawLight() → {PIXI.Container}

Source:

Draw the display of this source for the darkness/light container of the SightLayer.

Returns:

The rendered light container

Type
PIXI.Container

initialize(x, y, zopt, dim, bright, angle, rotation, color, alpha, darknessThreshold, type, animation, seed) → {PointSource}

Source:

Initialize the source with provided object data.

Parameters:
Name Type Attributes Description
x number

The x-coordinate of the source location

y number

The y-coordinate of the source location

z number <optional>

An optional z-index sorting for the source

dim number

The allowed radius of dim vision or illumination

bright number

The allowed radius of bright vision or illumination

angle number

The angle of emission for this point source

rotation number

The angle of rotation for this point source

color string

A tint color for the emitted light, if any

alpha number

An opacity for the emitted light, if any

darknessThreshold number

A level of darkness beyond which this light is active

type string

The source type from SOURCE_TYPES

animation object

An animation configuration for the source

seed number

An integer seed to synchronize (or de-synchronize) animations

Returns:

A reference to the initialized source

Type
PointSource