8000 GitHub - avgjs/pixi-live2d at v1.0.1
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Jan 9, 2025. It is now read-only.

avgjs/pixi-live2d

Repository files navigation

pixi-live2d

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.

Installation

npm install pixi-live2d

Example

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.

API

docs/API.md

License

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.

Donation

The plugin is free for charge, if you like it don't forget to buy me a coffee!

ko-fi:
Buy Me a Coffee at ko-fi.com

alipay:

0