Home Reference Source

Function

Static Public Summary
public
public
public
public
public
public
public

L2DModelMatrix(w: *, h: *)

public
public

L2DPartsParam(id: *)

public
public
public
public
public
public

A matrix stack releated to draw the model

public

ModelSettingJson(null: *): Structure

return the struct of ModelSettingJson

public

PlatformManager(null: *): Structure

Define the variable type of PlatformManager

public

cManager(eventemitter: *)

public

cModel()

public

captureFrame(callback: Function): null

Capture current frame to png file

public

configApplyer(userConfig: Object): null

Apply users function, make the full settings

public

Create the canvas and styles using DOM

public

Get current script path

public

theRealInit(emitter: *): null

Main function of live2d-widget

Static Public

public EYE_STATE() source

public L2DBaseModel() source

import {L2DBaseModel} from 'live2d-widget/src/lib/Live2DFramework.js'

public L2DExpressionMotion() source

import {L2DExpressionMotion} from 'live2d-widget/src/lib/Live2DFramework.js'

public L2DExpressionParam() source

import {L2DExpressionParam} from 'live2d-widget/src/lib/Live2DFramework.js'
import {L2DEyeBlink} from 'live2d-widget/src/lib/Live2DFramework.js'

public L2DMatrix44() source

import {L2DMatrix44} from 'live2d-widget/src/lib/Live2DFramework.js'

public L2DModelMatrix(w: *, h: *) source

import {L2DModelMatrix} from 'live2d-widget/src/lib/Live2DFramework.js'

Params:

NameTypeAttributeDescription
w *
h *

public L2DMotionManager() source

import {L2DMotionManager} from 'live2d-widget/src/lib/Live2DFramework.js'

public L2DPartsParam(id: *) source

import {L2DPartsParam} from 'live2d-widget/src/lib/Live2DFramework.js'

Params:

NameTypeAttributeDescription
id *

public L2DPhysics() source

import {L2DPhysics} from 'live2d-widget/src/lib/Live2DFramework.js'

public L2DPose() source

public L2DTargetPoint() source

import {L2DTargetPoint} from 'live2d-widget/src/lib/Live2DFramework.js'

public L2DViewMatrix() source

import {L2DViewMatrix} from 'live2d-widget/src/lib/Live2DFramework.js'

public Live2DFramework() source

import {Live2DFramework} from 'live2d-widget/src/lib/Live2DFramework.js'

public MatrixStack() source

import {MatrixStack} from 'live2d-widget/src/utils/MatrixStack.js'

A matrix stack releated to draw the model

public ModelSettingJson(null: *): Structure source

import {ModelSettingJson} from 'live2d-widget/src/utils/ModelSettingJson.js'

return the struct of ModelSettingJson

Params:

NameTypeAttributeDescription
null *

Return:

Structure

ModelSettingJson

public PlatformManager(null: *): Structure source

import {PlatformManager} from 'live2d-widget/src/PlatformManager.js'

Define the variable type of PlatformManager

Params:

NameTypeAttributeDescription
null *

Return:

Structure

PlatformManager

public cManager(eventemitter: *) source

import {cManager} from 'live2d-widget/src/cManager.js'

Params:

NameTypeAttributeDescription
eventemitter *

public cModel() source

import {cModel} from 'live2d-widget/src/cModel.js'

public captureFrame(callback: Function): null source

import {captureFrame} from 'live2d-widget/src/cLive2DApp.js'

Capture current frame to png file

Params:

NameTypeAttributeDescription
callback Function

The callback function which will receive the current frame

Return:

null

Example:

You can use codes below to let the user download the current frame

L2Dwidget.captureFrame(
  function(e){
    let link = document.createElement('a');
    document.body.appendChild(link);
    link.setAttribute('type', 'hidden');
    link.href = e;
    link.download = 'live2d.png';
    link.click();
  }
);

public configApplyer(userConfig: Object): null source

import {configApplyer} from 'live2d-widget/src/config/configMgr.js'

Apply users function, make the full settings

Params:

NameTypeAttributeDescription
userConfig Object
  • optional

User's custom config

Return:

null

public createElement(): null source

import {createElement} from 'live2d-widget/src/elementMgr.js'

Create the canvas and styles using DOM

Return:

null

public getCurrentPath(): String source

import {getCurrentPath} from 'live2d-widget/src/wpPublicPath.js'

Get current script path

Return:

String

The path of current script

Example:

get 'file:///C:/git/live2d-widget/dev/bundle.js' or 'https://www.host.com/test/js/bundle.js'

public theRealInit(emitter: *): null source

import {theRealInit} from 'live2d-widget/src/cLive2DApp.js'

Main function of live2d-widget

Params:

NameTypeAttributeDescription
emitter *

Return:

null