API Docs for:
Show:

Component_MessageBehavior Class

Module: vn

A behavior-component to define the behavior of a game-message.

Methods

actionTrigger

() Boolean

Checks if a mouse-button or key was pressed to continue with the message-rendering.

Returns:

Boolean:

If true, the an action-button or action-key is pressed.

addMessage

(
  • message
  • character
  • newLine
)

Adds a new message.

Parameters:

  • message String
    • The message.
  • character Object
    • Database-Record of a character.
  • newLine Boolean
    • Indicates if the message should make a line break.

autoMessageTime

() Number

Gets the time between two messages in auto-read mode.

Returns:

Number:

The time in frames.

clear

()

Clears the game message by deleting/clearing all messages.

close

()

Closes the game message by making it invisible.

messageDuration

() Number

Gets the duration of rendering the game-message.

Returns:

Number:

The duration in frames.

messageSpeed

() Number

Gets the current message speed.

Returns:

Number:

The message speed.

onDataBundleRestore.

(
  • Object
  • gs.ObjectCodecContext
)

Provided by the gs module.

Called if this object instance is restored from a data-bundle. It can be used re-assign event-handler, anonymous functions, etc.

Parameters:

  • Object Object

    data - The data-bundle

  • gs.ObjectCodecContext Object

    context - The codec-context.

restore

(
  • bundle
)

Not implemented yet.

Parameters:

  • bundle Object
    • A data bundle.

restoreMessages

(
  • messages
)

Restores a NVL game message of an array of message-objects. That is necessary to restore a NVL game message from a save-game.

Parameters:

  • messages Array
    • An array of messages to restore.

setup

()

Setup the component. Adds event handlers.

setupEventHandlers

()

Adds event-handlers

showMessage

(
  • sender
  • params
)

Action to show a game message.

Parameters:

  • sender Object
    • The sender of this action.
  • params Object
    • An object containing the necessary parameters.

toDataBundle

()

Disposes the component.

toDataBundle

()

Not implemented yet.

updateAutoMessage

() private

Update auto-read mode.

updateBitmap

()

Deprecated. Not longer used.

updateMessage

() private

Updates the message.

updateObject

() private

Updates the object.

updateOrigin

()

FIXME: Deprecated? It is also a re-definition of gs.Component_Visual.updateOrigin.

updateSpeed

() private

Updates the speed of the message. That depends on game-settings if a message is timed to its voice or not.

voiceDuration

() Number

Gets the duration of an associated voice or 0 if no voice is associated.

Returns:

Number:

The duration in frames.

Properties

autoMessageEnabled

Boolean

Indicates if the auto-message is enabled.

caretPosition

gs.Point

Current message caret/cursor position.

isRunning

Boolean

Indicates if the message is currently running.

isVoicePlaying

Boolean

Indicates if a voice is currently playing together with the message.

isWaiting

Boolean

Indicates if the message is currently waiting.

message

String

Current raw message text.

messages

String

All currently displayed raw messages.

partial

Boolean deprecated

Indicates if current message is partial. DEPRECATED. Please do not use.

settings

Object protected

Reference to temporary game settings.

settings

Object protected

Reference to game settings.

voice

gs.AudioBufferReference

Voice associated with the current message.

waitingPreview

Boolean

Indicates if the message is currently waiting in live-preview.