急!!Uncaught TypeError: tex.once is not a function?

texture-util.js:48 Uncaught TypeError: tex.once is not a function
at Object.loadImage (texture-util.js:48)
at cc_SpriteFrame._loadTexture (CCSpriteFrame.js:455)
at cc_SpriteFrame.setTexture (CCSpriteFrame.js:444)
at cc_SpriteFrame.ctor (CCSpriteFrame.js:225)
at new cc_SpriteFrame (eval at _createCtor (CCClass.js:609), :10:7)
at loong.setSpriteFrames (loong.js:79)
at shooter.createLoong (shooter.js:269)
at shooter. (shooter.js:163)
at CallbackTimer.32.proto.trigger (CCScheduler.js:241)
at CallbackTimer.32.proto.update (CCScheduler.js:207)

var url = cc.url.raw(‘resources/loong/loong.png’);
this.loongImage.spriteFrame = new cc.SpriteFrame(url);

用最版本,这行代码报上面的错,有什么办法解决不?

没有人遇到过吗?

官方应该改变了加载资源的方式,建议看看文档

没找到相关问题的文档

你是远程加载还是动态加载本地文件

https://docs.cocos.com/creator/manual/zh/scripting/load-assets.html

加载本的,
var url = cc.url.raw(‘resources/loong/loong.png’);
this.loongImage.spriteFrame = new cc.SpriteFrame(url);
这二行代码是换一种方式来加载?

应该是,因为2.0和之前的1.几版本就是一个分水岭

新手这代码不知要如何写

我上面给你连接了,官方文档也写的比较清楚