Commit f0ca8420 authored by wjf's avatar wjf

l

parent 86196e48
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -165,11 +165,7 @@ export class MovieClip extends egret.DisplayObjectContainer { ...@@ -165,11 +165,7 @@ export class MovieClip extends egret.DisplayObjectContainer {
//加个名字,暂时用imageKey,如果有一致的imageKey,会覆盖 //加个名字,暂时用imageKey,如果有一致的imageKey,会覆盖
this[ele.imageKey] = child; this[ele.imageKey] = child;
//透明度处理 //透明度处理
if (ele.frames[0].alpha < 0.05) {
child.visible = false;
} else {
child.alpha = ele.frames[0].alpha; child.alpha = ele.frames[0].alpha;
}
child["frames"] = ele.frames; child["frames"] = ele.frames;
var transform = ele.frames[0].transform var transform = ele.frames[0].transform
child.matrix = new egret.Matrix().copyFrom(transform); child.matrix = new egret.Matrix().copyFrom(transform);
...@@ -461,10 +457,6 @@ export class MovieClip extends egret.DisplayObjectContainer { ...@@ -461,10 +457,6 @@ export class MovieClip extends egret.DisplayObjectContainer {
if (child["frames"] && child["frames"][s._curFrame - 1]) { if (child["frames"] && child["frames"][s._curFrame - 1]) {
var frame = child["frames"][s._curFrame - 1]; var frame = child["frames"][s._curFrame - 1];
//layout不晓得干嘛用,暂不管 //layout不晓得干嘛用,暂不管
if (frame.alpha < 0.05) {
child.visible = false;
} else {
child.visible = true;
child.alpha = frame.alpha; child.alpha = frame.alpha;
//先判断transform是否相等 //先判断transform是否相等
if (!child.matrix.equals(frame.transform)) { if (!child.matrix.equals(frame.transform)) {
...@@ -472,7 +464,6 @@ export class MovieClip extends egret.DisplayObjectContainer { ...@@ -472,7 +464,6 @@ export class MovieClip extends egret.DisplayObjectContainer {
} }
} }
} }
}
//事件播放结束监听,不确定白鹭是否是COMPLETE,待试验 //事件播放结束监听,不确定白鹭是否是COMPLETE,待试验
if (!s.lockStep) { if (!s.lockStep) {
if (((s._curFrame == 1 && !s._isFront) || (s._curFrame == s.totalFrames && s._isFront)) && s.hasEventListener(egret.Event.COMPLETE)) { if (((s._curFrame == 1 && !s._isFront) || (s._curFrame == s.totalFrames && s._isFront)) && s.hasEventListener(egret.Event.COMPLETE)) {
...@@ -557,3 +548,25 @@ function getAsset(source, compFunc, thisObject) { ...@@ -557,3 +548,25 @@ function getAsset(source, compFunc, thisObject) {
RES.getResByUrl(source, compFunc, thisObject, RES.ResourceItem.TYPE_IMAGE); RES.getResByUrl(source, compFunc, thisObject, RES.ResourceItem.TYPE_IMAGE);
} }
} }
function deepCopyFrames(frames, tx, ty, scaleX = 1, scaleY = 1) {
var cf = [];
for (var j = 0; j < frames.length; j++) {
var frame = frames[j];
const pt = frame.transform;
var f = { alpha: 0, transform: null };
//透明度
f.alpha = frame.alpha;
f.transform = {
a: scaleX * pt.a,
b: scaleX * pt.b,
c: scaleY * pt.c,
d: scaleY * pt.d,
tx: (tx * pt.a) + (ty * pt.c) + pt.tx,
ty: (tx * pt.b) + (ty * pt.d) + pt.ty,
};
cf.push(f)
}
return cf;
}
\ No newline at end of file
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