Commit 86196e48 authored by wjf's avatar wjf

l

parent 3e032468
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -161,17 +161,9 @@ export class MovieClip extends egret.DisplayObjectContainer {
for (var i = 0, len = sprites.length; i < len; i++) {
var ele = sprites[i];
if (ele.imageKey) {
var child
var splitArr = ele.imageKey.split("_");
//需要标记的,预留其他类型
if (splitArr[1] && splitArr[1] == "spr") {
child = new egret.Bitmap(this.textures[ele.imageKey]);
this[splitArr[0]] = child;
}
//一般不需要标记的
else {
child = new egret.Bitmap(this.textures[ele.imageKey]);
}
var child = new egret.Bitmap(this.textures[ele.imageKey]);
//加个名字,暂时用imageKey,如果有一致的imageKey,会覆盖
this[ele.imageKey] = child;
//透明度处理
if (ele.frames[0].alpha < 0.05) {
child.visible = false;
......
......@@ -67,34 +67,47 @@
function aaa(videoItem) {
var obj = {};
//帧率 60 30 等
obj.FPS = videoItem.FPS;
//帧数 81等
obj.frames = videoItem.frames;
//尺寸
obj.videoSize = videoItem.videoSize;
//所有的部件
obj.sprites = [];
for (var i = 0; i < videoItem.sprites.length; i++) {
var sprite = videoItem.sprites[i];
var s = {};
//图片键值
s.imageKey = sprite.imageKey;
//动画帧数据组
s.frames = [];
for (var j = 0; j < sprite.frames.length; j++) {
var frame = sprite.frames[j];
var f = {};
f.alpha = frame.alpha;
//透明度
f.alpha = cutFour(frame.alpha);
//矩阵数据,考虑用对象还是数组
f.transform = [
frame.transform.a,
frame.transform.b,
frame.transform.c,
frame.transform.d,
frame.transform.tx,
frame.transform.ty,
cutFour(frame.transform.a),
cutFour(frame.transform.b),
cutFour(frame.transform.c),
cutFour(frame.transform.d),
cutFour(frame.transform.tx),
cutFour(frame.transform.ty),
];
s.frames.push(f)
}
obj.sprites.push(s)
}
// obj.sprites = videoItem.sprites
return obj
}
function cutFour(number) {
var reg = /^(.*\..{4}).*$/;
var temp = String(number).replace(reg, "$1");
return Number(temp);
}
</script>
</body>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment