sprite中的spriteFrame的图片url怎么用代码读出来

请教,sprite中的spriteFrame的图片url怎么用代码读出来?我觉得这应该是spriteFrame的一个属性

比如是不是类似this.sprite.spriteFrame.url就能读出来(url是乱写的),cc.log输出的结果能是“图片/xxx.png”?

你可以用这个试试 this.sprite.spriteFrame.getTexture().url;

试了一下,显示undefined

我搞定了!!找到了一个其他帖子写的别的内容,下面有团队的回复,找到了,是用_textureFilename属性读出来!

Visen 说的是正解,你之前读不到可能是因为 texture 还没加载进来。用 _textureFilename 也是可以的。

请问this.sprite.spriteFrame.getTexture().url;和_textureFilename 有什么特殊的区别吗?