VOPlayer

platypus. VOPlayer

new VOPlayer(game, assetCache)

This class is used to create platypus.game.voPlayer and manages playback by only playing one at a time, playing a list, and even handling captions at the same time.

This class borrows heavily from SpringRoll v1 to match the original capabilities exposed for Platypus v1.

Source:
Parameters:
Name Type Description
game Game

The game instance for which to play audio.

assetCache assetManager

The Platypus assetManager used to load and unload VO clips.

Extends

Members

destroyed :Boolean

This read-only property shows whether this Messenger is destroyed.

Properties:
Name Type Description
destroyed
Inherited From:
Default Value:
  • false
Source:
Type:
  • Boolean

Methods

destroy()

This method relinguishes Messenger properties

Inherited From:
Source:

getMessageIds() → {Array}

This method returns all the messages that this entity is concerned about.

Inherited From:
Source:
Returns:
Type:
Array

An array of strings listing all the messages for which this Messenger has handlers.

off(name, callback)

Remove the event listener

Inherited From:
Source:
Parameters:
Name Type Description
name String

The type of event; if no name is specifed remove all listeners.

callback function

The listener function.

on(name, callback)

Add an event listener. The parameters for the listener functions depend on the event.

Inherited From:
Source:
Parameters:
Name Type Description
name String

The type of event.

callback function

The callback function when event is triggered.

toString()

Returns a string describing the Messenger as "[Messenger object]".

Inherited From:
Source:
Returns:

String

trigger(event, value, debug) → {number}

This method is used by both internal components and external entities to trigger messages. When triggered, Messenger checks through bound handlers to run as appropriate. This handles multiple event structures: "", [], and {}

Inherited From:
Source:
Parameters:
Name Type Description
event String | Array | Object

This is the message(s) to process. This can be a string, an object containing an "event" property (and optionally a "message" property, overriding the value below), or an array of the same.

value *

This is a message object or other value to pass along to event handler.

debug boolean

This flags whether to output message contents and subscriber information to the console during game development. A "value" object parameter (above) will also set this flag if value.debug is set to true.

Returns:
Type:
number

The number of handlers for the triggered message.

triggerEvent(event, valueopt) → {number}

This method is used by both internal components and external entities to trigger messages on this entity. When triggered, entity checks through bound handlers to run as appropriate. This method is identical to Spring Roll's EventDispatcher.trigger, but uses alternative Array methods to alleviate excessive GC.

Inherited From:
Source:
Parameters:
Name Type Attributes Description
event String

This is the message to process.

value * <optional>

This is a message object or other value to pass along to event handler.

Name Type Attributes Description
debug boolean <optional>

This flags whether to output message contents and subscriber information to the console during game development.

Returns:
Type:
number

The number of handlers for the triggered message.

Events

end

Fired when a new VO, caption, or silence timer completes

Source:
Parameters:
Name Type Description
currentVO String

The alias of the VO or caption that has begun, or null if it is a silence timer.

start

Fired when a new VO, caption, or silence timer begins

Source:
Parameters:
Name Type Description
currentVO String

The alias of the VO or caption that has begun, or null if it is a silence timer.