1. LayerGradient
var layer1 = cc.LayerGradient.create(cc.color(255, 0, 0, 255), cc.color(0, 255, 0, 255), cc.p(0.9, 0.9));
this.addChild(layer1, 0, cc.TAG_LAYER);
updateGradient:function(pos) {
var diff = cc.pSub(cc.p(winSize.width / 2, winSize.height / 2), pos);
diff = cc.pNormalize(diff);
var gradient = this.getChildByTag(1);
gradient.setVector(diff);
},
var gradient = this.getChildByTag(cc.TAG_LAYER);
gradient.setCompressedInterpolation(!gradient.isCompressedInterpolation());
2. Loader
cc.loader.load([s_Cowboy_plist, s_Cowboy_png], function(results){
cc.log(s_Cowboy_plist + "--->", results[0]);
cc.log(s_Cowboy_png + "--->", results[1]);
cc.spriteFrameCache.addSpriteFrames(s_Cowboy_plist);
var frame = cc.Sprite.create("#testAnimationResource/1.png")
self.addChild(frame);
frame.x = winSize.width/4;
frame.y = winSize.height/4;
});