Live2D in Electron – live2d-widget.js

As part of a larger project (upcoming), I am currently working on an electron application, which has Live2D as a key feature. After digging around Github, I found xiazeyu/live2d-widget.js, a JavaScript implementation of Live2D.

This tutorial was originally intended for Electron. However, I soon found that it applies to all platforms, not just Electron. Thus, feel free to continue even if you’re using something else. Everything should apply as long as it is HTML-JS based.

Using Live2d in live2d-widget.js

Importing Live2d-Widget.js is easy. Simply download the JavaScript files and then place them in your electron project folder. Then, import Live2d-Widget in your html file.

<script src="L2Dwidget.min.js"></script>

Next, create a canvas for your Live2D figure.

Continue reading →