Cocos Creator 动态改变sprite图片

首先将存放图片最外层文件夹命名为resources
   changeBj: function(){
    var url = 'globalUI/video/gVideoPlayClick';
    var _this = this; cc.loader.loadRes(url,cc.SpriteFrame,function(err,spriteFrame)
    {  
      _this.isPlay.spriteFrame = spriteFrame;
     });
 
   
    //加载网络图片
var url = "http://localhost:3274/";
cc.loader.load({url: url, type: 'png'}, function(err,img){
var mylogo = new cc.SpriteFrame(img);
self.logo.spriteFrame = mylogo;
});
 
   }
上一篇:UVA 11134 Fabled Rooks 贪心


下一篇:Advanced Configuration Tricks