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) embeddedName
- Source:
bounds
- Source:
- Overrides:
The bounding box for this PlaceableObject. This is required if the layer uses a Quadtree, otherwise it is optional
brightRadius
- Source:
Get the pixel radius of bright light emitted by this light source
center :PIXI.Point
- Source:
- Overrides:
The central coordinate pair of the placeable object based on it's own width and height
Type:
- PIXI.Point
controlIcon :ControlIcon
- Source:
- Overrides:
A control icon for interacting with the object
Type:
data :Object
- Source:
- Overrides:
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|null
- Source:
- Overrides:
The field-of-vision polygon for the object, if it has been computed
Type:
- PIXI.Polygon | null
global :boolean
- Source:
Test whether a specific AmbientLight source provides global illumination
Type:
- boolean
id :string
- Source:
- Overrides:
The _id of the underlying EmbeddedEntity
Type:
- string
isVisible
- Source:
Return whether the light source is currently visible in the scene
los :PIXI.Polygon|null
- Source:
- Overrides:
The line-of-sight polygon for the object, if it has been computed
Type:
- PIXI.Polygon | null
mouseInteractionManager :MouseInteractionManager
- Source:
- Overrides:
A mouse interaction manager instance which handles mouse workflows related to this object.
Type:
scene :Scene
- Source:
- Overrides:
Retain a reference to the Scene within which this Placeable Object resides
Type:
sheet :FormApplication
- Source:
- Overrides:
A Form Application which is used to configure the properties of this Placeable Object or the EmbeddedEntity it represents.
Type:
source :PointSource
- Source:
A reference to the PointSource object which defines this light source area of effect
Type:
sourceId
- Source:
The named identified for the source object associated with this light
uuid :string
- Source:
- Overrides:
A Universally Unique Identifier (uuid) for this EmbeddedEntity
Type:
- string
vision :Object
- 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:
- Object
Methods
_updateRotation(angleopt, deltaopt, snapopt) → {number}
- Source:
- Overrides:
Determine a new angle of rotation for a PlaceableObject either from an explicit angle or from a delta offset.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
angle |
number |
<optional> |
An explicit angle, either this or delta must be provided |
delta |
number |
<optional> |
A relative angle delta, either this or the angle must be provided |
snap |
number |
<optional> |
A precision (in degrees) to which the resulting angle should snap. Default is 0. |
Returns:
The new rotation angle for the object
- Type
- number
activateListeners()
- Source:
- Overrides:
Activate interactivity for the Placeable Object
can(user, action) → {boolean}
- Source:
- Overrides:
Test whether a user can perform a certain interaction with regards to a Placeable Object
Parameters:
Name | Type | Description |
---|---|---|
user |
User | The User performing the action |
action |
string | The named action being attempted |
Returns:
Does the User have rights to perform the action?
- Type
- boolean
clear() → {PlaceableObject}
- Source:
- Overrides:
Clear the display of the existing object
Returns:
The cleared object
- Type
- PlaceableObject
clone() → {PlaceableObject}
- Source:
- Overrides:
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
control(options) → {boolean}
- Source:
- Overrides:
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
|
Returns:
A flag denoting whether or not control was successful
- Type
- boolean
(async) delete()
- Source:
- Overrides:
(async) draw() → {PlaceableObject}
- Source:
- Overrides:
Draw the placeable object into its parent container
Returns:
The drawn object
- Type
- PlaceableObject
getFlag(scope, key) → {*}
- Source:
- Overrides:
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 current display state of the Placeable Object
Returns:
The refreshed object
- Type
- PlaceableObject
release(options) → {boolean}
- Source:
- Overrides:
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.<PlaceableObject>}
- Source:
- Overrides:
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.<PlaceableObject>
(async) setFlag(scope, key, value) → {Promise}
- Source:
- Overrides:
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
(async) unsetFlag(scope, key) → {Promise}
- Source:
- Overrides:
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:
- Overrides:
updateSource(defer, deleted)
- Source:
Update the source object associated with this light
Parameters:
Name | Type | Description |
---|---|---|
defer |
boolean | Defer refreshing the LightingLayer to manually call that refresh later. |
deleted |
boolean | Indicate that this light source has been deleted. |