1
는 내가이 PLIST 파일이 있습니다읽는 방법 PLIST 수준
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<key>levels</key>
<array>
<dict>
<key>x</key>
<int>80</int>
<key>y</key>
<int>266</int>
</dict>
<dict>
<key>x</key>
<int>170</int>
<key>y</key>
<int>266</int>
</dict>
</array>
</plist>
을 그리고 cocos2dx V3.2를 사용하여이 파일을 읽을려고 그런 식으로 :
ValueMap data;
std::string path = FileUtils::getInstance()->fullPathForFilename("my.plist");
data = FileUtils::getInstance()->getValueMapFromFile(path);
auto arrLevels = data.at("levels").asValueVector();
for(int i = 0; i < arrLevels.capacity(); i++){
//I don't know what I have to do here to get the x value and y value of the current item.
}
누군가 나를 도울 수 있습니까? 나는 모든 인터넷에서 검색하고 있는데 이것에 대한 모든 예제는 결함이 있습니다.
덕분에이 문제가 해결되었습니다. – Guilherme