Constructor
new core/GestureFeature(host, optionsopt, layers)
Parameters:
Name | Type | Attributes | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
host |
core/HostObject | Host object that owns the feature. |
||||||||||||||||
options |
Object |
<optional> |
Optional options for the feature. Properties
|
|||||||||||||||
layers |
Object | An object that maps layer names to layer options. |
Extends
Members
(readonly) host
Gets the host that manages the feature.
- Overrides:
(readonly) owner
Gets the engine owner object of the host.
- Overrides:
Methods
createGenericGestureArray(layersopt) → {Array.<string>}
Create an array that contains ssml mark syntax required to play each gesture
that does not have any associated words. The resulting array can be used as
an input for TextToSpeechUtils.autoGenerateSSMLMarks or
TextToSpeechUtils.addMarksToUnmarkedSentences to update a speech
string with the markup required to play random gestures at each unmarked
sentence in the string.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
layers |
Array.<string> |
<optional> |
An array of names of managed layers to generate |
Returns:
- Type
- Array.<string>
createGestureMap() → {Object}
Create an object that maps ssml mark syntax required to play each gesture to
the words array associated with each gesture. Words arrays are defined at when
the gesture animation is registered. Gestures without associated words will
be excluded from the result. The resulting object can be used as an input
for TextToSpeechUtils.autoGenerateSSMLMarks to update a speech string
with the markup required to play gestures timed with their associated words.
Returns:
- Type
- Object
discard()
Clean up once the feature is no longer in use. Remove the feature namespace
from the host and remove reference to the host.
- Overrides:
- Implements:
emit(message, valueopt)
Emit feature messages from the host. Feature messages will be prefixed with
the class name of the feature.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
message |
string | The message to emit. |
|
value |
any |
<optional> |
Optional parameter to pass to listener callbacks. |
- Overrides:
installApi()
Adds a namespace to the host with the name of the feature to contain properties
and methods from the feature that users of the host need access to.
- Overrides:
listenTo(message, callback)
Listen to a feature message from the host object.
Parameters:
Name | Type | Description |
---|---|---|
message |
string | Message to listen for. |
callback |
function | The callback to execute when the message is received. |
- Overrides:
playGesture(layerName, animationName, optionsopt)
Play a managed gesture animation.
Parameters:
Name | Type | Attributes | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
layerName |
string | The name of the layer that contains the gesture |
|||||||||||||
animationName |
string | The name of the gesture animation. |
|||||||||||||
options |
Object |
<optional> |
Optional gesture options. Properties
|
registerAnimation(layerName, animationName, optionsopt)
Start tracking keeping track of whether an animation with the given name is
present on the host.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
layerName |
string | Name of the layer that will own the animation. |
|
animationName |
string | Name of the animation to keep track of. |
|
options |
Object |
<optional> |
Options for the animation. |
- Implements:
registerLayer(name, optionsopt)
Start tracking keeping track of whether a layer with the given name is present
on the host.
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
name |
string | Name of the layer to keep track of. |
|||||||||||||||||
options |
Object |
<optional> |
Options for the layer. Properties
|
- Implements:
stopListening(message, callbackopt)
Stop listening to a message from the host object.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
message |
string | Message to stop listening for. |
|
callback |
function |
<optional> |
Optional callback to remove. If none is defined, |
- Overrides:
stopListeningByRegexp(regexp, callbackopt)
Stop listening to a message matching the given regular expression from the
host object.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
regexp |
Regexp | The regular expression to stop listening for. |
|
callback |
function |
<optional> |
Optional callback to remove. If none is defined, |
- Overrides:
stopListeningToAll()
Stop listening to all messages.
- Overrides:
update(deltaTime)
Executes each time the host is updated.
Parameters:
Name | Type | Description |
---|---|---|
deltaTime |
number | Amount of time since the last host update was |
- Overrides: