|
1 | 1 | <picture> |
2 | 2 | <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/NarraLeaf/.github/refs/heads/master/doc/banner-md-transparent.png"> |
3 | 3 | <source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/NarraLeaf/.github/refs/heads/master/doc/banner-md-light.png"> |
4 | | - <img alt="Fallback image description" src="https://raw.githubusercontent.com/NarraLeaf/.github/refs/heads/master/doc/banner-md-light.png"> |
| 4 | + <img alt="NarraLeaf Logo" src="https://raw.githubusercontent.com/NarraLeaf/.github/refs/heads/master/doc/banner-md-light.png"> |
5 | 5 | </picture> |
6 | 6 |
|
7 | 7 | <h1 align="center">NarraLeaf-React</h1> |
@@ -31,49 +31,36 @@ NarraLeaf-React uses TypeScript for all scripting, so you don't have to learn a |
31 | 31 | It also has a highly abstracted and easy-to-use API, for example: |
32 | 32 |
|
33 | 33 | ```typescript |
34 | | -import {Character, Menu, Scene, Word, c, b} from "narraleaf-react"; |
| 34 | +import {Character, Menu, Scene, c, b} from "narraleaf-react"; |
35 | 35 | ``` |
36 | 36 |
|
37 | 37 | ```typescript |
38 | | -const scene1 = new Scene("scene1_hello_world", { |
39 | | - background: "/background/scene1_hello_world.jpg", |
| 38 | +const scene1 = new Scene("Scene1: Hello World", { |
| 39 | + background: "/link/to/background.jpg", |
40 | 40 | }); |
41 | 41 |
|
42 | | -const johnSmith = new Character("John Smith"); |
43 | | -const johnDoe = new Character("John Doe"); |
| 42 | +const jS = new Character("John Smith"); |
| 43 | +const jD = new Character("John Doe"); |
44 | 44 |
|
45 | 45 | scene1.action([ |
46 | | - /** |
47 | | - * John Smith: Hello, world! |
48 | | - * John Smith: This is my first **NarraLeaf** story. |
49 | | - * John Smith: Start editing src/story.js and enjoy the journey! |
50 | | - */ |
51 | | - johnSmith |
52 | | - .say("Hello, world!") |
53 | | - .say`This is my first ${b("NarraLeaf")} story.` |
54 | | - .say`Start editing ${c("src/story.js", "#00f")} and enjoy the journey!`, |
55 | | - |
56 | | - /** |
57 | | - * John Doe: Also, don't forget to check out the documentation! |
58 | | - */ |
59 | | - johnDoe.say("Also, don't forget to check out the documentation!"), |
60 | | - |
61 | | - /** |
62 | | - * Menu: Start the journey |
63 | | - * > Yes I will! |
64 | | - * - John Smith: Great! Let's start the journey! |
65 | | - * - John Smith: You can open issues on GitHub if you have any questions. |
66 | | - * > No, I'm going to check the documentation |
67 | | - * - John Smith: Sure! Take your time! |
68 | | - */ |
| 46 | + jS`Hello, world!`, |
| 47 | + jS`This is my first ${b("NarraLeaf")} story.`, |
| 48 | + jS`Start editing ${c("src/story.js", "#00f")} and enjoy the journey!`, |
| 49 | + |
| 50 | + jD`Also, don't forget to check out the ${c("documentation", "#00f")}!`, |
| 51 | + |
| 52 | + "By the way, the documentation is available on https://react.narraleaf.com/documentation", |
| 53 | + "You can also visit the website for demo and more information.", |
| 54 | + |
69 | 55 | Menu.prompt("Start the journey") |
| 56 | + |
70 | 57 | .choose("Yes I will!", [ |
71 | | - johnSmith |
72 | | - .say("Great! Let's start the journey!") |
73 | | - .say("You can open issues on GitHub if you have any questions.") |
| 58 | + jS`Great! Let's start the journey!`, |
| 59 | + jS`You can open issues on GitHub if you have any questions.` |
74 | 60 | ]) |
| 61 | + |
75 | 62 | .choose("No, I'm going to check the documentation", [ |
76 | | - johnSmith.say("Sure! Take your time!") |
| 63 | + jS`Sure! Take your time!` |
77 | 64 | ]) |
78 | 65 | ]); |
79 | 66 | ``` |
@@ -133,6 +120,17 @@ npm install narraleaf-react |
133 | 120 | - [Plugin](https://react.narraleaf.com/documentation/core/plugin) |
134 | 121 | - [Utils](https://react.narraleaf.com/documentation/core/utils) |
135 | 122 | - [Player](https://react.narraleaf.com/documentation/player) |
| 123 | + - [Player](https://react.narraleaf.com/documentation/player/player) |
| 124 | + - [GameProviders](https://react.narraleaf.com/documentation/player/game-providers) |
| 125 | + - Hooks |
| 126 | + - [useGame](https://react.narraleaf.com/documentation/player/hooks/useGame) |
| 127 | + - [usePreferences](https://react.narraleaf.com/documentation/player/hooks/usePreferences) |
| 128 | + - [useRouter](https://react.narraleaf.com/documentation/player/hooks/useRouter) |
| 129 | + - [useDialog](https://react.narraleaf.com/documentation/player/hooks/useDialog) |
| 130 | + - [Page Router](https://react.narraleaf.com/documentation/player/page-router) |
| 131 | + - [Dialog](https://react.narraleaf.com/documentation/player/dialog) |
| 132 | + - [Notification](https://react.narraleaf.com/documentation/player/notification) |
| 133 | + - [Menu](https://react.narraleaf.com/documentation/player/menu) |
136 | 134 | - About |
137 | 135 | - [License](https://react.narraleaf.com/documentation/info/license) |
138 | 136 | - [Incompatible Changes](https://react.narraleaf.com/documentation/info/incompatible-changes) |
|
0 commit comments