Display live2D model as a sprite in pixi.js.
Installation | Example | API | License | Donation
Pixi-live2d is a plugin for pixi.js for displaying live2D model as a sprite in pixi.js.
- Only available in WebGL
- ECMAScript 2015+
- Have a look at example!
- Make me know if you use my plugin for cool things!
npm install pixi-live2d
import PIXI from 'pixi.js';
import 'pixi-live2d';
const renderer = new PIXI.WebGLRenderer(800, 600);
document.body.appendChild(renderer.view);
const stage = new PIXI.Container();
const live2dSprite = new PIXI.Live2DSprite(modelHaru);
stage.addChild(live2dSprite);
live2dSprite.startRandomMotion('idle');
live2dSprite.on('mousemove', (evt) => {
const point = evt.data.global;
live2dSprite.setViewPoint(point.x, point.y);
});
function animate() {
requestAnimationFrame(animate);
renderer.render(stage);
}
animate();
You can find a more complex one at example
folder, or visit it online.
This plugin is distributed under MIT license, and you should agree with the licenses of Live2D and pixi.js.
For more detail, please read LICENSE.txt.
The plugin is free for charge, if you like it don't forget to buy me a coffee!