Commit 6f3c8807 authored by wjf's avatar wjf

l

parent fe3b6f64
...@@ -184,7 +184,8 @@ export class MovieClip extends egret.DisplayObjectContainer { ...@@ -184,7 +184,8 @@ export class MovieClip extends egret.DisplayObjectContainer {
// child.x = 0; // child.x = 0;
// child.y = 0; // child.y = 0;
this.addChild(child) this.addChild(child)
//记录下
child["imageKey"] = ele.imageKey;
} }
} }
// console.log(this) // console.log(this)
...@@ -201,12 +202,10 @@ export class MovieClip extends egret.DisplayObjectContainer { ...@@ -201,12 +202,10 @@ export class MovieClip extends egret.DisplayObjectContainer {
var width = texture.textureWidth; var width = texture.textureWidth;
var height = texture.textureHeight; var height = texture.textureHeight;
getAsset(imageUrl, function (tex, key) { getAsset(imageUrl, function (tex, key) {
//替换掉this.textures[imagekey]
this.textures[imagekey] = tex;
for (var i = 0; i < this.children.length; i++) { for (var i = 0; i < this.children.length; i++) {
let child = this.children[i] let child = this.children[i]
//texture相等 //texture相等
if (child.texture == texture) child.texture = tex if (child.imagekey == imagekey) child.texture = tex
} }
}, this) }, this)
} }
......
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