我因为要用来制作box2d的刚体的点,,,需要取到tiled map中object的polyline的点。。。。
<object id="46"name="wall"type="floor"x="0"y="400"width=“1000”>
TMXObjectGroup* objectGroup = map->getObjectGroup("Object1");
ValueVector object = objectGroup->getObjects();
for (ValueVector::iterator it = object.begin(); it != object.end(); it++) {
Value obj = *it;
ValueMap map = obj.asValueMap();
//这些都能取到
std::string name = map.at("name").asString();
std::string type = map.at("type").asString();
int height = map.at("height").asInt();
int width = map.at("width").asInt();
//这些都能取到,但是下面报错:
std::string word = map.at("polylinePoints").asString();
log("字符处啊是==========%s",word.c_str() );
}
报错如下:
Assert failed: Only base type (bool, string, float, double, int) could be converted
Assertion failed: (_type != Type::VECTOR && _type != Type::MAP && _type != Type::INT_KEY_MAP), function asString, file /Users/shadow/game/test/cocos2d/cocos/base/CCValue.cpp, line 603.
.那么问题来了,我该怎么取到polylinePoints里面的点的数据呢???????求大神支招