creator和cocos2dx中 精灵setTexture的不同之处

Creator 版本号:1.5.0 beta3
运行时目标平台:Web
手机浏览器平台:浏览器

在cocos2dx中,我们有一种换肤需求
有两张大小一样的图片A B.
基于图片A我们创建了很多的精灵,这些精灵分别显示了图片A上的不同区域。
在换肤的时候,我们需要显示图片B上的内容,同时还需要保证当前精灵显示的图片区域不会发生变化

所以在cocos2dx中我们是这么实现的
有一个成员的变量
m_pTexture
所有的精灵都是基于这个Texure创建出来的
auto pSprite1 = Sprite::createWithTexture(m_pTexture, Rect(0,0,100,100));

auto pSpriteN = Sprite::createWithTexture(m_pTexture, Rect(N,N,100,100));
当我们需要换肤的时候,我们只需要修改m_pTexture对应的图片,就可以完成换肤功能
m_pTexture->initWithImage(pImage);
此时的pImage已经载入了B图了

这样所有的精灵都会显示图片B上的元素,这样就完成了一套换肤功能

但是

我发现同样的方法在cocos creator似乎就没法生效了
properties中,我预先定义了精灵
testSprite1: cc.Sprite
testSprite2: cc.Sprite
同样的,依然有一个成员变量用来保存Texture
testTexture: cc.Texture2D

onLoad

// creator中,精灵默认的spriteFrame被我删掉了,所以此处new一个
this.testSprite1.spriteFrame = new cc.SpriteFrame()
this.testSprite2.spriteFrame = new cc.SpriteFrame();

this.testSprite1.spriteFrame.setTexture(this.cardTexure);
this.testSprite2.spriteFrame.setTexture(this.cardTexure);

this.testSprite1.spriteFrame.setRect(cc.rect(0,0,90,120));
this.testSprite2.spriteFrame.setRect(cc.rect(0,240,90,120));

在某个按钮点击事件中,载入新的图片

var imageURL = cc.url.raw('resources/123.png');
this.cardTexure = cc.textureCache.addImage(imageURL);

很显然,那么这里的改变,并不会影响到testSprite中的texture

那么我想问下,在cocos中如何实现我们的这个需求?

可以用另外的方式实现
加载两个图集(cc.SpriteAtlas),代表两个不同的皮肤

应用某个皮肤时:

changeSkin: function(atlas) {
  testScript.scpriteFrame = atlas.getSpriteFrame("par1")
  testScrip2.scpriteFrame = atlas.getSpriteFrame("par2")
}

这个方案是可行,但是我没有使用.
因为在cocos2dx中,我用texture,只需要把texture对应的图片修改掉,所有基于这个texture的精灵显示都会自动刷新
这样我就不用单独维护每个精灵,每一个都给他们赋值

而你这个方案,我需要把每个我想要改的精灵都找出来
然后把spriteFrame重新赋值.

@maoanjie 就没下文了?刚接触creator也遇到这个问题了。。。