Classes
Members
(inner) branchReading :string
name of branch currently reading
Type:
- string
(inner) choisesElement :HTMLElement
Type:
- HTMLElement
(inner) config :Object
config
Type:
- Object
(inner) dialogElement :HTMLElement
Type:
- HTMLElement
(inner) handlers :Object
there are 4 handlers: handlers.Text, handlers.BackImage, handlers.Effects, handlers.Media
Type:
- Object
(inner) objects :Map.<string, SceneObject>
contains all scene objects
Type:
- Map.<string, SceneObject>
(inner) readingIndex :number
current dialog
Type:
- number
(inner) registered :Array.<Object>
there will be all dialogs
Type:
- Array.<Object>
(inner) scene :HTMLElement
scene element. there will be placed all sprites
Type:
- HTMLElement
(inner) sounds :Object.<string, Sound>
there will be all sounds
Type:
- Object.<string, Sound>
(inner) sprites :Map
there will be all sprites
Type:
- Map
(inner) textElement :HTMLElement
Type:
- HTMLElement
(inner) typing :boolean
true, if Text is typing text
Type:
- boolean
(inner) typingInterval :number
interval (from setInterval) of typing
Type:
- number
(inner) varibles :Map
contains all user-created varibles
Type:
- Map
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 |
(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 |
(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 |
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;
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;
(inner) registerDialog(dialog)
adds dialog to Engine#registered
Parameters:
| Name | Type | Description |
|---|---|---|
dialog |
Object |
(inner) setTitle(text)
sets html > head > title innerHTML. Title of the page
Parameters:
| Name | Type | Description |
|---|---|---|
text |
string | new title |