AmbientSound

AmbientSound

An AmbientSound is an implementation of PlaceableObject which represents a dynamic audio source within the Scene.

Constructor

new AmbientSound()

Source:
Example
AmbientSound.create({
  t: "l",
  x: 1000,
  y: 1000,
  radius: 60,
  easing: true,
  path: "sounds/audio-file.mp3",
  repeat: true,
  volume: 0.4
});

Extends

Members

(static) embeddedName

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

fov :PIXI.Polygon|null

Source:
Overrides:

The field-of-vision polygon for the object, if it has been computed

Type:
  • PIXI.Polygon | null

howl :Howl

Source:

The Howl instance used to play this AmbientSound effect

Type:
  • Howl

howlId :Number

Source:

The Howl sound ID of the playing instance of this sound

Type:

id :string

Source:
Overrides:

The _id of the underlying EmbeddedEntity

Type:
  • string

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:

radius

Source:

A convenience accessor for the sound radius in pixels

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:

type

Source:

A convenience accessor for the sound type

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

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:
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
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:
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
*

play(isAudible, volume)

Source:

Toggle playback of the sound depending on whether or not it is audible

Parameters:
Name Type Description
isAudible Boolean

Is the sound audible?

volume Number

The target playback volume

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: