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 {
//加个名字,暂时用imageKey,如果有一致的imageKey,会覆盖
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;
var transform = ele.frames[0].transform
child.matrix = new egret.Matrix().copyFrom(transform);
......@@ -461,15 +457,10 @@ export class MovieClip extends egret.DisplayObjectContainer {
if (child["frames"] && child["frames"][s._curFrame - 1]) {
var frame = child["frames"][s._curFrame - 1];
//layout不晓得干嘛用,暂不管
if (frame.alpha < 0.05) {
child.visible = false;
} else {
child.visible = true;
child.alpha = frame.alpha;
//先判断transform是否相等
if (!child.matrix.equals(frame.transform)) {
child.matrix = new egret.Matrix().copyFrom(frame.transform);
}
child.alpha = frame.alpha;
//先判断transform是否相等
if (!child.matrix.equals(frame.transform)) {
child.matrix = new egret.Matrix().copyFrom(frame.transform);
}
}
}
......@@ -556,4 +547,26 @@ function getAsset(source, compFunc, thisObject) {
else {
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