706 auto map = cocos2d::FastTMXTiledMap::create(
"TileMaps/iso-test-objectgroup.tmx");
709 Size CC_UNUSED s = map->getContentSize();
710 CCLOG(
"ContentSize: %f, %f", s.width,s.height);
712 auto group = map->getObjectGroup(
"Object Group 1");
714 auto& objects = group->getObjects();
716 Value objectsVal = Value(objects);
717 CCLOG(
"%s", objectsVal.getDescription().c_str());
719 auto drawNode = DrawNode::create();
720 Color4F color(1.0, 1.0, 1.0, 1.0);
721 for (
auto& obj : objects)
723 ValueMap& dict = obj.asValueMap();
725 float x = dict[
"x"].asFloat();
726 float y = dict[
"y"].asFloat();
727 float width = dict[
"width"].asFloat();
728 float height = dict[
"height"].asFloat();
730 drawNode->drawLine(Vec2(x, y), Vec2(x + width, y), color);
731 drawNode->drawLine(Vec2(x + width, y), Vec2(x + width, y + height), color);
732 drawNode->drawLine(Vec2(x + width,y + height), Vec2(x,y + height), color);
733 drawNode->drawLine(Vec2(x,y + height), Vec2(x,y), color);
735 map->addChild(drawNode, 10);