Currently I am extending a Sprite and initializing it as follows:
this._super(); this.initWithFile('./Resources/sprite1.png', new cc.Rect(0, 0, 128, 128));
However, I want to overlay sprite1.png with sprite2.png and use THAT for my Sprite texture. I thought of creating a Node with two child Sprites, however this will complicate things heavily when I start thinking of animations.
My goal is something like:
texture1 = cc.TextureCache.getInstance().textureForKey('./Resources/sprite1.png'); texture2 = cc.TextureCache.getInstance().textureForKey('./Resources/sprite2.png'); texture = texture1.combineWith(texture2);
And from there I would initialize the Sprite with the combined texture as opposed to one individual file.
Of course, it will probably be more complicated than what is above. Does anybody happen to have thoughts on the best way to approach this problem?