在Cocos2d-x 3.17版本中,CCFileUtils::sharedFileUtils()->fullPathFromRelativePath函数已被移除,因此无法在升级到Cocos2d-x 3.17后使用该函数。

相反,您可以使用新的cocos2d::FileUtils::getInstance()->fullPathForFilename函数来实现相同的功能。以下是示例代码:

std::string fullPath = cocos2d::FileUtils::getInstance()->fullPathForFilename("relative_path/file.png");

请注意,fullPathForFilename函数的参数应该是相对路径而不是绝对路径。如果您已经有一个绝对路径,请使用cocos2d::FileUtils::getInstance()->isAbsolutePath函数来检查它是否为绝对路径。

希望这可以帮助到你!

cocos2dx20升级到cocos2dx 317后CCFileUtilssharedFileUtils-fullPathFromRelativePath提示No member named fullPathFromRelativePath in cocos2dFileUtils

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

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