API List
[10000] Register model event listener
Description
Register model event listener
Example
{
"msg": 10000,
"msgId": 1
}
Response
{
"msg": 10000,
"msgId": 1
}
[10001] Unregister model event listener
Description
Unregister model event listener
Example
{
"msg": 10001,
"msgId": 1
}
[10002] Receive model event notification
Description
Receive model event notification
Response
{
"msg": 10002,
"msgId": 1,
"data": {
"type": 0,
"id": 0,
"modelId": "myModelId",
"hitArea": "myHitArea"
}
}
Parameter |
Type |
Description |
type |
int |
event type |
id |
int |
index of model (0 - 4) |
modelId |
string |
model ID, configured by modeler, can be empty |
hitArea |
string |
hit area name, can be empty |
Event Type
type |
Description |
0 |
tap event |
[11000] Show Text Bubble
Description
Show the text bubble of specific model
Example
{
"msg": 11000,
"msgId": 1,
"data": {
"id": 0,
"text": "Hello this is control panel.",
"choices": [
"Open Baidu",
"Open Google"
],
"textFrameColor": 0x000000,
"textColor": 0xFFFFFF,
"duration": 3000
}
}
Parameter |
Type |
Description |
id |
int |
index of model (0 - 4) |
text |
string |
text to show supported tags: Rich Text |
choices |
array |
choice buttons |
textFrameColor |
int |
text frame color, RGB Integer(e.g. 0xFFFFFF) |
textColor |
int |
text color, RGB Integer(e.g. 0xFFFFFF) |
duration |
int |
duration of showing, value is millisecond if set to -1, the bubble will not disappear automatically |
Response
{
"msg": 11000,
"msgId": 1,
"data": 0 //index of clicked button
}
[12000] Set Background
Description
Example
{
"msg": 12000,
"msgId": 1,
"data": "D:\Wallpaper\background.png"
}
Parameter |
Type |
Description |
data |
string |
path of background file |
Type |
Formats |
Image |
".png", ".jpg", ".jpeg" |
Video |
".mp4", ".mkv", ".mov", ".avi", ".webm", ".wmv" |
Web |
".html", ".htm", ".xhtml" |
[12100] Set 360 Background
Description
Example
{
"msg": 12100,
"msgId": 1,
"data": "D:\Wallpaper\360background.png"
}
Parameter |
Type |
Description |
data |
string |
path of background files |
Type |
Formats |
Image |
".png", ".jpg", ".jpeg" |
Video |
".mp4", ".mkv", ".mov", ".avi", ".webm", ".wmv" |
[13000] Set Model
Description
Set model, supports json model only
Example
{
"msg": 13000,
"msgId": 1,
"data": {
"id": 1,
"file": "D:\Unity Works\Sample\Kurumi\kurumi.model.json"
}
}
Parameter |
Type |
Description |
id |
int |
index of model (0 - 4) |
file |
string |
path of model.json file |
[13100] Remove Model
Description
Example
{
"msg": 13100,
"msgId": 1,
"data": 1
}
Parameter |
Type |
Description |
data |
int |
index of model (0 - 4) |
[13200] Start Motion
Description
Example
{
"msg": 13200,
"msgId": 1,
"data": {
"id": 1,
"mtn": "group:motion"
}
}
Parameter |
Type |
Description |
id |
int |
index of model (0 - 4) |
mtn |
string |
format is 'group:motion', e.g. 'tap:mtn1' ※ If you do not specify motion, write the group name directly, e.g. 'tap' |
[13300] Set Expression
Description
Example
{
"msg": 13300,
"msgId": 1,
"data": {
"id": 1,
"expId": 1
}
}
Parameter |
Type |
Description |
id |
int |
index of model (0 - 4) |
expId |
int |
index of expression |
[13301] Next Expression
Description
Example
{
"msg": 13301,
"msgId": 1,
"data": 0
}
Parameter |
Type |
Description |
data |
int |
index of model (0 - 4) |
[13302] Clear Expression
Description
Example
{
"msg": 13302,
"msgId": 1,
"data": 0
}
Parameter |
Type |
Description |
data |
int |
index of model (0 - 4) |
[14000] Set Effect
Description
Set effect and remove other effects
Example
{
"msg": 14000,
"msgId": 1,
"data": 100100
}
Parameter |
Type |
Description |
data |
int |
effect Id, refer to ID List below |
ID List
ID |
Description |
100100 |
Rain |
100110 |
Snow |
[14100] Add Effect
Description
Example
{
"msg": 14100,
"msgId": 1,
"data": 100100
}
Parameter |
Type |
Description |
data |
int |
effect ID, refer to ID List |
[14200] Remove Effect
Description
Remove effect with specific ID, set to -1 to remove all effects
Example
{
"msg": 14200,
"msgId": 1,
"data": 100100
}
Parameter |
Type |
Description |
data |
int |
effect ID, refer to ID List |