Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/avgjs/pixi-live2d
Display live2D model as a sprite in pixi.js.
https://github.com/avgjs/pixi-live2d
live2d pixi pixi-live2d pixijs
Last synced: 2 months ago
JSON representation
Display live2D model as a sprite in pixi.js.
- Host: GitHub
- URL: https://github.com/avgjs/pixi-live2d
- Owner: avgjs
- License: other
- Created: 2016-10-13T14:20:55.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-04-12T15:06:58.000Z (about 7 years ago)
- Last Synced: 2024-02-26T09:50:41.331Z (4 months ago)
- Topics: live2d, pixi, pixi-live2d, pixijs
- Language: JavaScript
- Homepage: https://avgjs.github.io/pixi-live2d-example/
- Size: 5.27 MB
- Stars: 666
- Watchers: 18
- Forks: 68
- Open Issues: 3
-
Metadata Files:
- Readme: readme.md
- License: LICENSE.txt
Lists
- awesome-acg - pixi-live2d - Display live2D model as a sprite in pixi.js. [English] (Web)
- awesome-stars - pixi-live2d
README
# pixi-live2d
Display live2D model as a sprite in [pixi.js](https://github.com/pixijs/pixi.js).
--------------------------------------------------------------------------------
[Installation](#installation) | [Example](#example) | [API](#api) | [License](#license) | [Donation](#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!](https://avgjs.github.io/pixi-live2d-example/)
- [Make me know](mailto:[email protected]?subject=Hey,%20I%20made%20a%20cool%20work%20with%20your%20plugin!) if you use my plugin for cool things!## Installation
```bash
npm install pixi-live2d
```**Attention**
Because of [the SDK policy](http://sites.cybernoids.jp/cubism-sdk2_e/policy-sdk) of Live2D Inc., SDK file has been removed from the package, so you have to [download](http://sites.cybernoids.jp/cubism-sdk2_e/webgl2-1) and import it by yourself.
for example in HTML file:
```html
```
or just require it
```javascript
require('live2d.min.js');
```## Example
```javascript
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](./example), or [visit it online](https://avgjs.github.io/pixi-live2d-example/).
## API
[docs/API.md](./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](./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](https://az743702.vo.msecnd.net/cdn/kofi4.png?v=b)](https://ko-fi.com/A742BTX)alipay:
![](https://cloud.githubusercontent.com/assets/837432/19645521/a71da460-9a27-11e6-9605-aed9e251dd7a.png)