Cocos2d-x 2.0 升级到 3.17 后 'fullPathFromRelativePath' 方法迁移指南
从 Cocos2d-x 2.0 升级到 Cocos2d-x 3.17 后,'cocos2d::FileUtils' 类中的 'member named 'fullPathFromRelativePath'' 已被移除。\n\n在 Cocos2d-x 3.17 中,可以使用以下方法来获取相对路径的完整路径:\n\n1. 使用 cocos2d::FileUtils::getInstance()->getWritablePath() 获取可写路径。\n\n2. 使用 cocos2d::FileUtils::getInstance()->fullPathForFilename(relativePath) 获取相对路径的完整路径。\n\n例如,假设你有一个相对路径为 "resources/image.png" 的文件:\n\ncpp\nstd::string fullPath = cocos2d::FileUtils::getInstance()->fullPathForFilename("resources/image.png");\n\n\n请注意,Cocos2d-x 3.17 中的文件系统类和方法与 Cocos2d-x 2.0 有所不同,因此在升级时可能需要进行其他更改。
原文地址: https://www.cveoy.top/t/topic/pLIG 著作权归作者所有。请勿转载和采集!