cc.loader.loadImg不能用了吗

cc.loader.loadImg is removed, please use load instead
这个是报错,
这个接口没用了,
哪个是代替的接口

cc.textureCache.addImageAsync(“http://www.cocos2d-x.org/s/upload/geometry_dash.jpg”, this.texLoaded, this);
用这个方法读取图片也是会报错,好像是跨域访问,怎么解决

Access to Image at ‘http://www.cocos2d-x.org/s/upload/geometry_dash.jpg’ from origin ‘http://localhost:7456’ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘http://localhost:7456’ is therefore not allowed access.
这是第二个方法的报错

遇到 API 的问题查 API 就知道了,Creator 中没有 loadImg,一律用 load 即可

http://cocos.com/docs/creator/api/classes/loader.html

你遇到的报错是远程图片不支持跨域,显示不出来的