MovieClip数据格式标准


MovieClip数据格式标准

https://developer.egret.com/cn/docs/page/595
https://bbs.egret.com/thread-918-1-1.html

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
{"mc":{
"mcName":{
"frameRate":24,
"labels":[
{"name":"fall","frame":1,"end":3}
,{"name":"move","frame":4,"end":6}
],
"events":[
{"name":"@fallhalf","frame":2}
,{"name":"@movehalf","frame":5}
],
"frames":[
{"res":"7ADF0F11","x":224,"y":123},
{"res":"69D013A4","x":228,"y":122},
{"res":"191777D3","x":228,"y":123},
{"res":"BD2A2889","x":222,"y":124},
{"res":"BCE2A311","x":227,"y":132},
{"res":"433DB5E0","x":228,"y":135}
]
}},
"res":{
"7ADF0F11":{"x":1,"y":87,"w":105,"h":80},
"69D013A4":{"x":111,"y":1,"w":104,"h":85},
"191777D3":{"x":108,"y":88,"w":98,"h":81},
"BD2A2889":{"x":1,"y":1,"w":108,"h":84},
"BCE2A311":{"x":110,"y":171,"w":97,"h":68},
"433DB5E0":{"x":104,"y":241,"w":95,"h":65}
}
}
  • mc
1
2
3
4
5
6
7
8
9
10
11
12
13
mcName: 代表一个 MovieClip 的名字,可以自定义修改,一个数据格式里可以包含多个 MovieClip ;
“frameRate” 帧率, 【可选属性】,默认值24,可以由开发者通过代码设定;
“labels”: 帧标签列表,【可选属性】,如果没有帧标签,可以不加这个属性;
"name": 标签名;
"frame": 标签所在的帧序号;
"end": 标签结束的帧序号,动画可以在标签内循环播放
“events”: 帧事件标签列表,【可选属性】,如果没有帧标签,可以不加这个属性;
"name": 事件标签名,以@开头;
"frame": 事件标签所在的帧序号;
“frames”: 关键帧数据列表;
"res": 该关键帧帧上需要显示的图片资源,【可选属性】,默认值为空(用于空白帧的情况)
"x": 图片需要显示的x坐标, 【可选属性】,默认值0
"y":图片需要显示的y坐标, 【可选属性】,默认值0
  • res

资源列表,列表中的每个属性都代表一个资源名,资源名中的属性为:

1
2
3
4
"x": 资源所在纹理集位置的x坐标;
"y": 资源所在纹理集位置的y坐标;
"w": 资源宽度;
"h": 资源高度;

其中:actions、scripts暂时还未启用,日后会用到的。