API Docs for:
Show:

Component_GameSceneBehavior Class

Module: vn

Defines the behavior of visual novel game scene.

Methods

addCharacter

(
  • character
  • noAnimation
  • animationData
)

Adds a new character to the scene.

Parameters:

  • character vn.Object_Character
    • The character to add.
  • noAnimation Boolean
    • Indicates if the character should be added immediately witout any appear-animation.
  • animationData Object
    • Contains the appear-animation data -> { animation, easing, duration }.

changeBackground

(
  • background
  • noAnimation
  • animation
  • easing
  • duration
  • ox
  • oy
  • layer
  • loopHorizontal
  • loopVertical
)

Changes the background of the scene.

Parameters:

  • background Object
    • The background graphic object -> { name }
  • noAnimation Boolean
    • Indicates if the background should be changed immediately witout any change-animation.
  • animation Object
    • The appear/disappear animation to use.
  • easing Object
    • The easing of the change animation.
  • duration Number
    • The duration of the change in frames.
  • ox Number
    • The x-origin of the background.
  • oy Number
    • The y-origin of the background.
  • layer Number
    • The background-layer to change.
  • loopHorizontal Boolean
    • Indicates if the background should be looped horizontally.
  • loopVertical Boolean
    • Indicates if the background should be looped vertically.

dispose

()

Disposes the scene.

initialize

()

Initializes the scene.

pauseScene

()

Pauses the current scene. A paused scene will not continue, messages, pictures, etc. will stop until the scene resumes.

prepareData

()

Prepares all data for the scene and loads the necessary graphic and audio resources.

prepareVisual

()

Prepares all visual game object for the scene.

removeCharacter

(
  • character
  • animationData
)

Removes a character from the scene.

Parameters:

  • character vn.Object_Character
    • The character to remove.
  • animationData Object
    • Contains the disappear-animation data -> { animation, easing, duration }.

restoreAudioPlayback

() protected

Restores audio-playback from loaded save game.

restoreInterpreter

() protected

Restores main interpreter from loaded save game.

restoreMessageBox

() protected

Restores message box from loaded save game.

restoreMessages

() protected

Restores message from loaded save game.

restoreScene

() protected

Restores the scene objects from the current loaded save-game. If no save-game is present in GameManager.loadedSaveGame, nothing will happen.

resumeScene

()

Resumes the current scene if it has been paused.

setupBackgrounds

() protected

Sets up backgrounds and restores them from loaded save game if necessary.

setupCharacters

() protected

Sets up characters and restores them from loaded save game if necessary.

setupCommonEvents

()

Sets up common event handling.

setupHotspots

() protected

Sets up hotspots and restores them from loaded save game if necessary.

setupInterpreter

() protected

Sets up main interpreter.

setupLayout

() protected

Sets up layout.

setupMainViewport

() protected

Sets up the main viewport / screen viewport.

setupPictures

() protected

Sets up pictures and restores them from loaded save game if necessary.

setupScreen

() protected

Sets up screen.

setupTexts

() protected

Sets up texts and restores them from loaded save game if necessary.

setupVideos

() protected

Sets up videos and restores them from loaded save game if necessary.

setupViewports

() protected

Sets up viewports and restores them from loaded save game if necessary.

show

(
  • visible
)

Shows/Hides the current scene. A hidden scene is no longer shown and executed but all objects and data is still there and be shown again anytime.

Parameters:

  • visible Boolean
    • Indicates if the scene should be shown or hidden.

showChoices

(
  • choices
  • callback
)

Shows choices to let the user pick a choice.

Parameters:

  • choices Object
    • An array of choices
  • callback gs.Callback
    • A callback function called if a choice has been picked by the user.

showInputNumber

(
  • digits
  • callback
)

Shows input-number box to let the user enter a number.

Parameters:

  • digits Number
    • The max. number of digits the user can enter.
  • callback gs.Callback
    • A callback function called if the input-number box has been accepted by the user.

showInputText

(
  • letters
  • callback
)

Shows input-text box to let the user enter a text.

Parameters:

  • letters Number
    • The max. number of letters the user can enter.
  • callback gs.Callback
    • A callback function called if the input-text box has been accepted by the user.

skipBackgrounds

() protected

Skips all background animations.

skipCharacters

() protected

Skips all character animations

skipCommonEvents

() protected

Skips the interpreter timer of all common events.

skipContent

() protected

Skips the scene's content.

skipInterpreter

() protected

Skips the scene interpreter timer.

skipMainViewport

() protected

Skips the main viewport animation.

skipMessageAreas

() protected

Skips all animations of all message areas.

skipMessageBoxes

() protected

Skips all animations of all message boxes defined in MESSAGE_BOX_IDS ui constant.

skipPictures

() protected

Skips all picture animations.

skipTexts

() protected

Skips all text animations.

skipVideos

() protected

Skips all video animations but not the video-playback itself.

skipViewports

() protected

Skips all viewport animations except the main viewport animation.

updateContent

()

Updates the scene's content.