L2Dwidget
The main entry point, which is ... nothing
Constructor Summary
Public Constructor | ||
public |
|
Member Summary
Public Members | ||
public |
config: * |
|
public |
eventHandlers: {} |
Method Summary
Public Methods | ||
public |
captureFrame(callback: Function): null Capture current frame to png file captureFrame |
|
public |
download current frame L2Dwidget.captureFrame |
|
public |
emit(name: *, args: ...*): * |
|
public |
The init function |
|
public |
on(name: *, handler: *): * |
Public Constructors
public constructor() source
Public Methods
public captureFrame(callback: Function): null source
Capture current frame to png file captureFrame
Params:
Name | Type | Attribute | Description |
callback | Function | The callback function which will receive the current frame |
public emit(name: *, args: ...*): * source
Params:
Name | Type | Attribute | Description |
name | * | ||
args | ...* |
Return:
* |
public init(userConfig: Object): null source
The init function
Params:
Name | Type | Attribute | Description |
userConfig | Object |
|
User's custom config 用户自定义设置 |
userConfig.model.jsonPath | String |
|
Path to Live2D model's main json eg. |
userConfig.model.scale | Number |
|
Scale between the model and the canvas 模型与canvas的缩放 |
userConfig.display.superSample | Number |
|
rate for super sampling rate 超采样等级 |
userConfig.display.width | Number |
|
Width to the canvas which shows the model canvas的长度 |
userConfig.display.height | Number |
|
Height to the canvas which shows the model canvas的高度 |
userConfig.display.position | String |
|
Left of right side to show 显示位置:左或右 |
userConfig.display.hOffset | Number |
|
Horizontal offset of the canvas canvas水平偏移 |
userConfig.display.vOffset | Number |
|
Vertical offset of the canvas canvas垂直偏移 |
userConfig.mobile.show | Boolean |
|
Whether to show on mobile device 是否在移动设备上显示 |
userConfig.mobile.scale | Number |
|
Scale on mobile device 移动设备上的缩放 |
userConfig.name.canvas | String |
|
ID name of the canvas canvas元素的ID |
userConfig.name.div | String |
|
ID name of the div div元素的ID |
userConfig.react.opacity | Number |
|
opacity 透明度 |
userConfig.dev.border | Boolean |
|
Whether to show border around the canvas 在canvas周围显示边界 |
userConfig.dialog.enable | Boolean |
|
Display dialog 显示人物对话框 |
userConfig.dialog.hitokoto | Boolean |
|
Enable hitokoto 使用一言API |
public on(name: *, handler: *): * source
Params:
Name | Type | Attribute | Description |
name | * | ||
handler | * |
Return:
* |