Cocos Creator 动态改变sprite图片

时间:2025-01-24 14:54:05
首先将存放图片最外层文件夹命名为resources
changeBj: function(){
var url = 'globalUI/video/gVideoPlayClick';
var _this = this; (url,,function(err,spriteFrame)
{  
_this. = spriteFrame;
});
 
 
//加载网络图片
        var url = "http://localhost:3274/";
        ({url: url, type: 'png'}, function(err,img){
            var mylogo  = new (img); 
             = mylogo;
        });

 
 }