Skip to main content

About Live2D

MahiruLess than 1 minute

About Live2D

The engine now supports using Live2D illustrations. If you want to use Live2D illustrations, please:

  1. Obtain the authorization of Live2D by yourself

  2. Download Live2D and Cubismcore from in new window and in new window respectively

  3. Rename them to live2d.min.js and live2dcubismcore.min.js respectively, then put the files in packages/webgal/public/lib, then go to packages/webgal/index.html, uncomment the following two lines to make them:

<script src="lib/live2d.min.js" ></script>
<script src="lib/live2dcubismcore.min.js"></script>
  1. Go to packages/webgal/src/Core/controller/stage/pixi/PixiController.ts, uncomment
    import { Live2DModel, SoundManager } from 'pixi-live2d-display'; and public addLive2dFigure(key: string, jsonPath: string, pos: string, motion: string) {...... uncomment this whole function}

Note: If the IDE prompts that there are unimported variables, please import them according to the prompts.

  1. Go to packages/webgal/src/Components/Stage/MainStage/useSetFigure.ts and uncomment return WebGAL.gameplay.pixiStage?.addLive2dFigure(...args);

  2. Now you can start using Live2D as illustrations. You need to put the directory of the entire model in the game/figure directory. The way to call the illustration is to call the JSON file of the illustration.

Note: The author of this project did not use any source code and models of Live2D SDK. Any copyright disputes caused by the use of Live2D shall be borne by the secondary developer or producer!

Switch actions and expressions

You can use the -motion=motionName or -expression=expressionName parameters to switch expressions, such as:

changeFigure:xxx.json -motion=angry -expression=angry01;