在Cocos2d-x 3.17版本中,spriteWithFile方法已经被移除了。取而代之的是使用Sprite::create方法来创建精灵对象。

使用Sprite::create方法的示例代码如下:

auto sprite = Sprite::create("image.png");

其中,"image.png"是精灵使用的图片文件路径。


原文地址: https://www.cveoy.top/t/topic/hWDn 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录