cocos2d js 怎样动态载入外部图片

官网没有详细样例,仅仅有看api,研究成果例如以下


        var that = this;
        var url = "http://xxxxxx";
        cc.loader.loadImg(url, null, function(err,img){
        	var logo  = new cc.Sprite(img); 
        	that.addChild(logo);
        	logo.x = size.width / 2;
        	logo.y = size.height / 2;
        });


原文地址:https://www.cnblogs.com/bhlsheji/p/5275915.html