FAQ
Frequently Asked Questions about Pixi’VN
Some common questions you may encounter.
In Pixi’VN, in some advanced features, it is necessary to use decorators.
By default, TypeScript does not enable the use of decorators. To enable the use of decorators in TypeScript, you must add the following configuration to the tsconfig.json file:
{
"compilerOptions": {
// ...
"experimentalDecorators": true
}
}In a visual novel, it's very useful to be able to "skip," accelerate, or skip multiple steps, or automatically advance to the next step after a period of time.
The suggested implementation for this feature is to create the following function:
const [skipEnabled, setSkipEnabled] = useState<boolean>(false);
const [autoEnabled, setAutoEnabled] = useState<boolean>(false);
const [recheckSkipAuto, setRecheckSkipAuto] = useState<number>(0);
useEffect(() => {
if (skipEnabled || autoEnabled) {
nextOnClick();
}
}, [skipEnabled, recheckSkipAuto, autoEnabled]);
function nextOnClick() {
narration
.continue({})
.then(() => {
if (skipEnabled) {
setTimeout(() => {
setRecheckSkipAuto((p) => p + 1);
}, 0.2);
} else if (autoEnabled) {
setTimeout(() => {
setRecheckSkipAuto((p) => p + 1);
}, 2);
}
})
.catch((e) => {
// ...
});
}
// Button for enable skip and auto ...Linking a character to an image to add to the canvas is a common feature in visual novels. It can be useful for example for showing the character's expression.
To do this, you just need to create a custom character or modify the existing one (it is already present in the templates). I recommend adding an array of strings containing the links/aliases of the images that make up the character (body, head...), and using an ImageContainer when you need to display the character.
例:
import { CharacterInterface, CharacterStoredClass } from "@drincs/pixi-vn";
export class Character
extends CharacterStoredClass
implements CharacterInterface
{
constructor(
id: string | { id: string; emotion: string },
props: CharacterProps,
) {
// ...
this.images = props.images ?? [];
}
// other properties...
readonly images: string[] = [];
}
interface CharacterProps {
// other properties...
images?: string[]; // is optional
}Now you can use the images property to show the character on the canvas.
import { newLabel, showImageContainer } from "@drincs/pixi-vn";
import { alice } from "../values/characters";
export const startLabel = newLabel("start", [
async () => {
await showImageContainer("alice", alice.images, {
xAlign: 0.5,
yAlign: 1,
});
},
]);If you are using ink:
You can create a custom hashtag command to use this feature. For example you can add a script with the following syntax and convert it to a show imagecontainer script:
# show character {character id} {parameters}import { HashtagCommands } from "@drincs/pixi-vn-ink";
import { getCharacterById } from "@drincs/pixi-vn";
HashtagCommands.add((script, convertListStringToObj) => {
// ...
if (
script[0] === "show" &&
script[1] === "character" &&
script.length > 2
) {
let character = getCharacterById(script[2]);
if (character) {
console.error("Character not found");
return false;
}
let characterId: string = script[2].split("@")[0]; // to remove the emotion
let oltherProps: string = script.slice(3).join(" ");
let images = character.images.join(" ");
let newScript: string = `show imagecontainer ${characterId} [${images}] ${oltherProps}`;
return newScript;
}
return false;
});I suggest the following hotkeys, based on the ones used in the pixi-vn-react-template:
SpaceorEnter(hold): Skip through the dialogue while pressed.SpaceorEnter(release): Continue the dialogue.F5orCtrl + S: Quick save the game.F9orCtrl + L: Quick load the most recent save.Esc: Open the settings modal.H: Open the history modal.K: Open the controls/hotkeys list.Tab: Toggle the quick actions wheel.Arrow Up/Arrow Down: Navigate the choices in a choice menu.
Function keys (F5, F9) are used as the primary bindings because they are rarely intercepted by the browser, with Ctrl + S/Ctrl + L provided as alternatives for keyboards or setups without function keys.
Pixi’VN is released under the GNU Lesser General Public License v2.1 (LGPL 2.1).
This license is designed for libraries, making it a great fit for a game engine like this.
Here’s what it means in simple, practical terms — even if you’re not an expert in licenses.
What You Can Freely Do
If you use Pixi’VN in your own project — for example, to create a game, a visual novel, or a tool — you have almost no restrictions.
You can:
- Use Pixi’VN in free or commercial projects: You can sell your game, publish it on Steam, itch.io, mobile stores, etc.
- Keep your game’s source code private: You are not required to open-source your project.
- Use Pixi’VN without giving credit: You are not required to mention Pixi’VN anywhere.
(Though we always appreciate it!) - Install and use the library from npm without limitations: Normal dependency usage is fully allowed.
When Restrictions Apply
The LGPL only matters if you modify Pixi’VN itself, meaning:
- you create a fork of the engine,
- you change its source code,
- or you distribute a modified version of the library.
In that case:
- Your modifications to Pixi’VN must remain open source: If you change the engine and distribute your version, you must publish your modifications.
- You must keep the same license (LGPL 2.1): Modified versions of the library must remain under LGPL.
These conditions apply only to the engine, not to your game.