Skip to content
プロジェクト

概要

Make your own visual novel using a lightweight front-end react visual novel framework.

Web・アプリ開発

この数値の測り方

計測したスター増加

24時間
0
7日間
0
15日間
履歴を収集中
1か月
履歴を収集中

期間ごとの純増数です。期間は重複しており、日別の値ではありません。未計測の値は空欄です。スター数は注目度の指標であり、品質の保証ではありません。

NarraLeaf Logo

NarraLeaf-React

A React visual novel player framework

English | 简体中文

What is NarraLeaf-React?

NarraLeaf-React is a lightweight front-end visual novel player.
NL focuses on visual novel playing, so the user interface can be customized very easily.

It doesn't use any rendering libraries and can be used on any web platform (e.g. Electron)

Why NarraLeaf-React?

  • Lightweight: NarraLeaf-React is a front-end framework, and it doesn't use any rendering libraries.
  • Customizable: You can customize the UI as you like, even replace the whole components.
  • Easy to use: It is easy to use and has a simple API that is built for developers. Based on OOP principles.

Scripting

NarraLeaf-React uses TypeScript for all scripting, so you don't have to learn a whole new language to use it.

It also has a highly abstracted and easy-to-use API, for example:

import {Character, Menu, Scene, c, b} from "narraleaf-react";
const scene1 = new Scene("Scene1: Hello World", {
  background: "/link/to/background.jpg",
});

const jS = new Character("John Smith");
const jD = new Character("John Doe");

scene1.action([
  jS`Hello, world!`,
  jS`This is my first ${b("NarraLeaf")} story.`,
  jS`Start editing ${c("src/story.js", "#00f")} and enjoy the journey!`,

  jD`Also, don't forget to check out the ${c("documentation", "#00f")}!`,

  "By the way, the documentation is available on https://www.narraleaf.com/docs/narraleaf-react",
  "You can also visit the website for demo and more information.",

  Menu.prompt("Start the journey")

    .choose("Yes I will!", [
      jS`Great! Let's start the journey!`,
      jS`You can open issues on GitHub if you have any questions.`
    ])

    .choose("No, I'm going to check the documentation", [
      jS`Sure! Take your time!`
    ])
]);

For more information, please visit the NarraLeaf-React documentation.

Recent engine APIs

  • LiveGame.captureImage({ maxEdge, type, quality, backgroundColor }) draws a screenshot at the wanted size and encodes it once
  • LiveGame.deserialize(save, { requireMatchingStory: true }) refuses a save written by another story before changing state
  • registerWordRenderer(id, component, { interactive: false }) lets a purely visual text effect pass the player's clicks through to the line
  • Backlog say entries carry the avatar shown at that line, while restored saves refuse unsafe image and CSS URLs
  • Layer({ parallax }) and Scene({ backgroundLayerParallax }) place layers at different distances from the camera
  • Video.show() and Video.hide() accept { duration, easing } to fade a clip in or out
  • GameConfig.preload replaces the built-in preload strategy, while preloadGate and the image cache budgets control the default path
  • Sound.play() resolves once playback starts; pass { waitForEnd: true } when the story must wait for the clip
  • GameState.getImageCache(), AudioManager.getCacheStats() and retainOnly() expose cache residency and budgets

Get Started

Install

npm install narraleaf-react

Documentation

Read more in the NarraLeaf-React documentation.

License

NarraLeaf-React is licensed under the MPL-2.0 License.

We updated the license to MPL-2.0 on 2024-9-24.

Contributing

We welcome all contributions.
If you have any ideas, just open an issue or a pull request.

関連プロジェクトを探す

読み込み中…