Module: Engine

Main engine file
Author:
  • Onien
Source:

Classes

Engine

Members

(inner) branchReading :string

name of branch currently reading
Type:
  • string
Source:

(inner) choisesElement :HTMLElement

Type:
  • HTMLElement
Source:

(inner) config :Object

config
Type:
  • Object
Source:

(inner) dialogElement :HTMLElement

Type:
  • HTMLElement
Source:

(inner) handlers :Object

there are 4 handlers: handlers.Text, handlers.BackImage, handlers.Effects, handlers.Media
Type:
  • Object
Source:

(inner) objects :Map.<string, SceneObject>

contains all scene objects
Type:
  • Map.<string, SceneObject>
Source:

(inner) readingIndex :number

current dialog
Type:
  • number
Source:

(inner) registered :Array.<Object>

there will be all dialogs
Type:
  • Array.<Object>
Source:

(inner) scene :HTMLElement

scene element. there will be placed all sprites
Type:
  • HTMLElement
Source:

(inner) sounds :Object.<string, Sound>

there will be all sounds
Type:
  • Object.<string, Sound>
Source:

(inner) sprites :Map

there will be all sprites
Type:
  • Map
Source:

(inner) textElement :HTMLElement

Type:
  • HTMLElement
Source:

(inner) typing :boolean

true, if Text is typing text
Type:
  • boolean
Source:

(inner) typingInterval :number

interval (from setInterval) of typing
Type:
  • number
Source:

(inner) varibles :Map

contains all user-created varibles
Type:
  • Map
Source:

Methods

(inner) constructor(backgroundImageElement, textElement, effect, mediaElement, choisesElement, config)

Parameters:
Name Type Description
backgroundImageElement HTMLElement background image element
textElement HTMLElement text element
effect HTMLElement effect element
mediaElement HTMLElement media parent element
choisesElement HTMLElement choises parent element
config Object
Source:

(inner) importScenario(file, loaded)

imports scenario from file. Uses "import" fucntion
Parameters:
Name Type Description
file string which file will be loaded
loaded function when file is loaded
Source:

(inner) next(indexopt, ?dialogopt) → {Object}

processes dialog from Engine#registered under index (index)
Parameters:
Name Type Attributes Default Description
index number <optional>
Engine#readingIndex
?dialog Object <optional>
null
Source:
Returns:
processed dialog
Type
Object

(inner) onTypingEnd()

this method calls when all text is typed or if next set to intstant mode
if next isnt undefined and its object (additional setting), it will read and handle settings
else, it will just call Engine#next and increment Engine@readingIndex;
Source:

(inner) registerDialog(dialog)

adds dialog to Engine#registered
Parameters:
Name Type Description
dialog Object
Source:

(inner) setTitle(text)

sets html > head > title innerHTML. Title of the page
Parameters:
Name Type Description
text string new title
Source: