- Part 1: Ink for Web
- Part 2: Story API
- Part 3: Getting and Setting Variables
- Part 4: Calling Ink Functions
- Part 5: Building an Interface
Ink for Web
Starting with more recent versions of Inky, functionality for running Ink in a browser can be accessed through the File -> “Export for web…” option.
Looking at main.js
The first part of the code in the main.js file takes the value storyContent and passes it to inkjs.Story() function, saving the result as an object, story, that drives the rest of the code.
Throughout the main.js code, this object, story, is used as the interface to Ink itself. It calls different parts of the interface and reacts through creating links and other content.
Lines 45 – 51 shows an example of this. The property canContinue is tested and, if true, then calls story.Continue() to get the next section of text.