npm.io
0.2.1 • Published 2d ago

@drincs/pixi-vn-live2d

Licence
Version
0.2.1
Deps
1
Size
164 kB
Vulns
0
Weekly
0

Live2D integration for Pixi’VN

pixi-vn-cover

npm version npm downloads per month jsDelivr hits (npm) NPM License Discord

@drincs/pixi-vn-live2d is a lightweight wrapper around untitled-pixi-live2d-engine, designed specifically to integrate Live2D models into Pixi’VN projects.

The library provides Pixi’VN-friendly abstractions for using Live2D models inside visual novels, making it easier to load, manage, and display Live2D content within the Pixi’VN ecosystem.

Example

import { canvas } from "@drincs/pixi-vn";
import { extensions } from "pixi.js";
import { Live2DPlugin } from "@drincs/pixi-vn-live2d/core";
import { Live2D } from "@drincs/pixi-vn-live2d";

// Register the Live2D render pipe before creating the Pixi'VN canvas application
extensions.add(Live2DPlugin);
Assets.add({ alias: "haru", src: "https://example.com/model/model3.json" });

const live2d = new Live2D({ source: "haru" });
await live2d.ready;
live2d.anchor.set(0.5);
live2d.x = canvas.width / 2;
live2d.y = canvas.height;

live2d.motion("Idle");

canvas.add("live2d", live2d);

Build

To build the library, run the following command:

npm run build

Keywords