素材弹出框组件src\components\library\library.jsx,组件使用时传入的数据格式解析如下
![]()
[
{
'name': 'Abby',
'md5': 'afab2d2141e9811bd89e385e9628cb5f.svg',
'type': 'sprite', // 素材类型
'tags': [// 素材标签,即素材的子类型
'people',
'person',
'drawing'
],
'info': [960, 720, 2], // 原图规格,以及原图和展示图片的比例
'json': {// 包含内容
'objName': 'Abby',
'sounds': [// 声音
{
'soundName': 'pop',
'soundID': -1,
'md5': '83a9787d4cb6f3b7632b4ddfebf74367.wav',
'sampleCount': 258,
'rate': 11025,
'format': ''
}
],
'costumes': [// 造型
{
'costumeName': 'abby-a',
'baseLayerID': -1,
'baseLayerMD5': 'afab2d2141e9811bd89e385e9628cb5f.svg',
'bitmapResolution': 1,
'rotationCenterX': 31,
'rotationCenterY': 100
}
// ......
],
'currentCostumeIndex': 0, // 添加到舞台时初始化展示的造型
'scratchX': -20,
'scratchY': -38,
'scale': 1,
'direction': 90,
'rotationStyle': 'normal',
'isDraggable': false,
'visible': true,
'spriteInfo': {}
}
}
]
View Code