ChatBubbles

ChatBubbles

The Chat Bubble Class This application displays a temporary message sent from a particular Token in the active Scene. The message is displayed on the HUD layer just above the Token.

Constructor

new ChatBubbles()

Source:

Members

bubbles :Object

Source:

Track active Chat Bubbles

Type:
  • Object

container

Source:

A reference to the chat bubbles HTML container in which rendered bubbles should live

Methods

_getDuration(The) → {Number}

Source:

Determine the length of time for which to display a chat bubble. Research suggests that average reading speed is 200 words per minute. Since these are short-form messages, we multiply reading speed by 1.5. Clamp the result between 1 second (minimum) and 20 seconds (maximum)

Parameters:
Name Type Description
The jQuery

HTML message

Returns:

The number of milliseconds for which to display the message

Type
Number

(async) say(token, message, emote) → {Promise}

Source:

Speak a message as a particular Token, displaying it as a chat bubble

Parameters:
Name Type Description
token Token

The speaking Token

message String

The spoken message text

emote Boolean

Whether to style the speech bubble as an emote

Returns:

A Promise which resolves once the chat bubble has been created

Type
Promise