AmbientLight

AmbientLight

An AmbientLight is an implementation of PlaceableObject which represents a dynamic light source within the Scene.

Constructor

new AmbientLight()

Source:
Example
AmbientLight.create({
  t: "l",
  x: 1000,
  y: 1000,
  rotation: 0,
  dim: 30,
  bright: 15,
  angle: 360,
  tintColor: "#FF0000",
  tintAlpha: 0.05
});

Extends

Members

(static) layer

Source:

brightRadius

Source:

Get the pixel radius of bright light emitted by this light source

center :Object

Source:
Inherited From:

The central coordinate pair of the placeable object based on it's own width and height

Type:
  • Object

controlIcon :ControlIcon

Source:
Overrides:

A control icon for interacting with the object

Type:

coords :Array

Source:
Inherited From:

The [x,y] coordinates of the placeable object within the Scene container

Type:

data :Object

Source:
Inherited From:

The underlying data object which provides the basis for this placeable object

Type:
  • Object

dimRadius

Source:

Get the pixel radius of dim light emitted by this light source

fov :PIXI.Polygon

Source:
Overrides:

Track the field of vision for the placeable object. This is necessary to determine whether a player has line-of-sight towards a placeable object or vice-versa

Type:
  • PIXI.Polygon

global :Boolean

Source:

Test whether a specific AmbientLight source provides global illumination

Type:
  • Boolean

id :string

Source:
Inherited From:

The EmbeddedDocument id of the underlying data object

Type:
  • string

isVisible

Source:

Return whether the light source is active based on the current scene darkness level

layer :PlaceablesLayer

Source:
Inherited From:

Return a reference to the singleton layer instance which contains placeables of this type

Type:

owner :Boolean

Source:
Inherited From:

A Boolean flag for whether the current game User has permission to control this token

Type:
  • Boolean

scene :Scene

Source:
Inherited From:

Retain a reference to the Scene within which this Placeable Object resides

Type:

sheet

Source:
Overrides:

Get a reference to the LightConfig sheet that is used to configure this light source

uuid :string

Source:
Inherited From:

A Universally Unique Identifier (uuid) for this Embedded Entity instance

Type:
  • string

Methods

clear()

Source:
Inherited From:

Clear the display of the existing object

clone() → {PlaceableObject}

Source:
Inherited From:

Clone the placeable object, returning a new object with identical attributes The returned object is non-interactive, and has no assigned ID If you plan to use it permanently you should call the create method

Returns:

A new object with identical data

Type
PlaceableObject

computeFOV() → {Object}

Source:

Compute the field-of-vision for an object, determining its effective line-of-sight and field-of-vision polygons

Returns:

An object containing the rays, LOS polygon, and FOV polygon for the light

Type
Object

control(options) → {boolean}

Source:
Inherited From:

Assume control over a PlaceableObject, flagging it as controlled and enabling downstream behaviors

Parameters:
Name Type Description
options Object

Additional options which modify the control request

Properties
Name Type Description
releaseOthers boolean

Release any other controlled objects first

Returns:

A flag denoting whether or not control was successful

Type
boolean

(async) delete()

Source:
Inherited From:

displayToFront()

Source:
Inherited From:

Shift the display of the PlaceableObject to the top of the rendering stack, above all other siblings

draw()

Source:
Overrides:

Draw the Light source

getFlag(scope, key) → {*}

Source:
Inherited From:

Get the value of a "flag" for this PlaceableObject See the setFlag method for more details on flags

Parameters:
Name Type Description
scope String

The flag scope which namespaces the key

key String

The flag key

Returns:

The flag value

Type
*

refresh() → {PlaceableObject}

Source:
Overrides:

Refresh the visual representation of the Placeable Object

Returns:

A reference to the refreshed object

Type
PlaceableObject

release(options) → {Boolean}

Source:
Inherited From:

Release control over a PlaceableObject, removing it from the controlled set

Parameters:
Name Type Description
options Object

Options which modify the releasing workflow

Returns:

A Boolean flag confirming the object was released.

Type
Boolean

(async) rotate(angle, snap) → {Promise}

Source:
Inherited From:

Rotate the PlaceableObject to a certain angle of facing

Parameters:
Name Type Description
angle number

The desired angle of rotation

snap number

Snap the angle of rotation to a certain target degree increment

Returns:

A Promise which resolves once the rotation has completed

Type
Promise

(async) setFlag(scope, key, value) → {Promise}

Source:
Inherited From:

Assign a "flag" to this Entity. Flags represent key-value type data which can be used to store flexible or arbitrary data required by either the core software, game systems, or user-created modules.

Each flag should be set using a scope which provides a namespace for the flag to help prevent collisions.

Flags set by the core software use the "core" scope. Flags set by game systems or modules should use the canonical name attribute for the module Flags set by an individual world should "world" as the scope.

Flag values can assume almost any data type. Setting a flag value to null will delete that flag.

Parameters:
Name Type Description
scope String

The flag scope which namespaces the key

key String

The flag key

value *

The flag value

Returns:

A Promise resolving to the updated PlaceableObject

Type
Promise

sortToBack()

Source:
Inherited From:

Sort the PlaceableObject to the back of the rendering stack, behind all other siblings. Update the database with the new minimal Z-index

sortToFront()

Source:
Inherited From:

Sort the PlaceableObject to the front of the rendering stack, above all other siblings. Update the database with the new maximal Z-index

(async) unsetFlag(scope, key) → {Promise}

Source:
Inherited From:

Remove a flag assigned to the Entity

Parameters:
Name Type Description
scope string

The flag scope which namespaces the key

key string

The flag key

Returns:

A Promise resolving to the updated Entity

Type
Promise

(async) update()

Source:
Inherited From: