-
-
Notifications
You must be signed in to change notification settings - Fork 126
Expand file tree
/
Copy pathmain.js
More file actions
executable file
·38 lines (31 loc) · 1.29 KB
/
main.js
File metadata and controls
executable file
·38 lines (31 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
'use strict';
/* global Monogatari, monogatari */
/**
* =============================================================================
* This is the file where you should put all your custom JavaScript code,
* depending on what you want to do, there are 3 different places in this file
* where you can add code.
*
* 1. Outside the $_ready function: At this point, the page may not be fully
* loaded yet, however you can interact with Monogatari to register new
* actions, components, labels, characters, etc.
*
* 2. Inside the $_ready function: At this point, the page has been loaded, and
* you can now interact with the HTML elements on it.
*
* 3. Inside the init function: At this point, Monogatari has been initialized,
* the event listeners for its inner workings have been registered, assets
* have been preloaded (if enabled) and your game is ready to be played.
*
* You should always keep the $_ready function as the last thing on this file.
* =============================================================================
**/
const { $_ready, $_ } = Monogatari;
// 1. Outside the $_ready function:
monogatari.debug.level(5);
$_ready (() => {
// 2. Inside the $_ready function:
monogatari.init ('#monogatari').then (() => {
// 3. Inside the init function:
});
});