Pixi’VN - PixiJS Visual Novel Engine


Pixi’VN is a very versatile and powerful visual novel/2D game engine. It is based on JavaScript/TypeScript and uses the Pixi.js library for rendering.

Its great versatility is due to the fact that Pixi’VN is a npm package, that provides various core features to manage story steps, dialogues, character, canvas, variable storage, saving and loading, and much more. This means that it can be used both to create visual novels and to create other types of 2D games (such as Point and Click Adventure Games, RPGs, etc...), with your favorite JavaScript framework (React, Vue, Angular, etc...).

Pixi’VN provides the ability to use Templates to get started quickly. Less experienced developers can use these templates to create a visual novel without much knowledge of JavaScript/TypeScript.

With the PixiVNJson implementation you have the option to use various types of narrative languages (in addition to JavaScript/TypeScript). Currently you can use the following:

Pixi’VN offers the possibility of adding an HTML Element with the same dimensions as the PixiJS Canvas to add an UI with JavaScript frameworks.

By "UI" is meant the elements that are above the canvas, such as buttons, forms, etc.


This allows the use of systems such as React, Vue, Angular, etc. to create much more complex UI screens with excellent performance.

Wiki

First steps

Advanced topics

Prerequisites

Before starting, you must have the following tools installed:

Project Initialization

To initialize a new project, you can use the following command:

# npm 
npm create pixi-vn@latest  
# yarn 
yarn create pixi-vn@latest  
# pnpm 
pnpm create pixi-vn@latest  
# bun 
bun create pixi-vn@latest

The supported template presets are:

( More templates will be added in the future, see this issue for more information )

After the project is initialized, you can open the project directory with your text editor (VSCode is recommended) and start developing your visual novel.

Into all templates there is a README.md file with more information about the project.



Example overview


The example shown is the template i Pixi’VN made in React.

For testing purposes we will recreate the visual novel Breakdown with Pixi’VN in this guide. Breakdown is a short story that has all the features that a visual novel should have. Josh Powlison, the creator of Breakdown, has given us permission to use his narration for educational purposes❤️.

The first page that appears is the main menu. From there, you can start the game, load a saved game, or go to the settings.

The game page is in /narration route. It contains the text box, character avatar, and canvas for the background image. The text box displays the text of the current dialogue. The character avatar displays the character speaking the dialogue. The background image is the background of the scene. When a choice has to be made, the choices are displayed at the top of the screen.

When you are in the game page, you can access with many features through a list of buttons located at the bottom. In this list you can save the game, load a saved game, skip the dialogue, auto play the dialogue, access to the history modal, and access to the settings modal.

The history modal is a list of all the dialogues and choices that have been displayed.

The settings modal allows you to change the text speed, go to full screen, edit theme colors, and change go to main menu. The settings for the audio have not been added nor the libraries to manage it, but I recommend adding them.

Keyboard shortcuts (hotkeys)

  • Space or Enter: Continue the dialogue.
  • Keep Space or Keep Enter: Skip the dialogue.
  • Alt + S: Quick save the game.
  • Alt + L: Quick load the game.
  • Alt + H: Open the history modal.
  • Esc: Open the settings modal.
  • Alt + V: Hide the UI (Show only the canvas).

Used libraries

This template uses the following libraries:

Core libraries:

  • Pixi’VN: A visual novel library.
  • Vite: A build tool that aims to provide a faster and leaner development experience for modern web projects.
  • Vite Checker: A Vite plugin that checks TypeScript types and ESLint on each build.
  • PWA Vite Plugin: A Vite plugin that provides PWA support. This allows the possibility of installing the game as a Progressive Web App.
  • Zustand: A small, fast, and scalable state management library.
  • React Router: A library that provides routing for React applications.
  • Tanstack Query: A library that provides a set of tools for getting, caching, and updating game data. 

UI libraries:

  • Mui Joy: A React UI framework that provides a set of components and styles for building a website.
  • Framer Motion: A simple yet powerful motion library for React.
  • Notistack: A library that provides snackbar notifications for React.
  • React Color Palette: A library that provides a color picker for React.

Text libraries:

  • i18next: A library that gives the possibility to manage multiple translations in the application.
  • Reacr Markdown: A library that allows you to render markdown in React components.
Updated 4 days ago
StatusReleased
CategoryTool
PlatformsHTML5
Rating
Rated 5.0 out of 5 stars
(1 total ratings)
AuthorDRincs Productions
GenreVisual Novel
Made withPixiJS
Tags2D, Game engine, html, ink, react, Ren'Py
LinksHomepage, Discord, Source code, Patreon, npm