@variussoft/vn-engine
v0.4.6
Published
VariusSoft visual novel engine runtime
Maintainers
Readme
@variussoft/vn-engine
Runtime package for visual-novel games by VariusSoft.
Documentation
- Full guide (EN):
ENGINE_USAGE_EN.md - Полное руководство (RU):
ENGINE_USAGE_RU.md - Cheatsheet:
CHEATSHEET.md
Build
npm run build
npm run typecheckQuick Start
import "./styles.css";
import { bootstrapEngine } from "@variussoft/vn-engine";
bootstrapEngine({
validateContent: true,
debug: false,
// optional, default is Ctrl+Alt+D
// debugHotkey: { key: "h", ctrl: true, shift: true },
onReady: async (engine) => {
await engine.registerFont("NoirPro", "fonts/NoirPro-Regular.ttf");
engine.writeText("Case #17", "NoirPro", { x: 960, y: 96, fontSize: 52 });
// i18n is available only if manifest.i18n is configured
await engine.i18n?.setLocale("en");
}
}).catch(console.error);Main Exports
import {
bootstrapEngine,
ContentLoader,
SceneView,
ScriptRunner,
registerMiniGame,
I18n,
ContentValidator,
MenuUI
} from "@variussoft/vn-engine";
import type {
MenuData,
CustomMenuItem,
AnimatorDef,
Action,
SceneData,
DialogueData
} from "@variussoft/vn-engine";
import type { MenuUIOptions } from "@variussoft/vn-engine";Features
- Scene Renderer: Pixi.js 8 with 1920x1080 design resolution and automatic letterboxing
- Hotspots: Rectangle, polygon, and pixel-perfect sprite hotspots
- Interactive Actors: Animated sprites with click/hover actions and pixel-perfect hit testing
- Dialogues & Cutscenes: Text, choices, voice, and animations
- Menu System: Customizable main menu with settings modal, language selection, and custom items
- Mini-games: Built-in
junk_searchandevidence_board, plus custom game support - i18n: Lazy-loaded locale files with
$keyresolution - Save System: Auto-save with localStorage or platform SDK
- Validation: Zod-based JSON content validation
- Debug Tools: Flags inspector, node jumper, hotspot overlay
Feedback
For feedback, questions, and suggestions: [email protected].
