1.在做屏蔽触摸时发现
extensions中的CCScrollView类
void CCScrollView::registerWithTouchDispatcher() { CCDirector::sharedDirector()->getTouchDispatcher()->addTargetedDelegate(this, 0, false); } 应该改成 void CCScrollView::registerWithTouchDispatcher() { CCDirector::sharedDirector()->getTouchDispatcher()->addTargetedDelegate(this, getTouchPriority(), false); }
2.tile map 不支持获取折线点
CCTMXXMLParser.cpp Line 677 else if (elementName == "polyline") { // find parent object's dict and add polyline-points to it // CCTMXObjectGroup* objectGroup = (CCTMXObjectGroup*)m_pObjectGroups->lastObject(); // CCDictionary* dict = (CCDictionary*)objectGroup->getObjects()->lastObject(); // TODO: dict->setObject:[attributeDict objectForKey:@"points"] forKey:@"polylinePoints"]; // find parent object's dict and add polygon-points to it CCTMXObjectGroup* objectGroup = (CCTMXObjectGroup*)m_pObjectGroups->lastObject(); CCDictionary* dict = (CCDictionary*)objectGroup->getObjects()->lastObject(); // get points value string const char* value = valueForKey("points", attributeDict); if(value) { CCArray* pPointsArray = new CCArray; // parse points string into a space-separated set of points stringstream pointsStream(value); string pointPair; while(std::getline(pointsStream, pointPair, ' ')) { // parse each point combo into a comma-separated x,y point stringstream pointStream(pointPair); string xStr,yStr; char buffer[32] = {0}; CCDictionary* pPointDict = new CCDictionary; // set x if(std::getline(pointStream, xStr, ',')) { int x = atoi(xStr.c_str()) + (int)objectGroup->getPositionOffset().x; sprintf(buffer, "%d", x); CCString* pStr = new CCString(buffer); pStr->autorelease(); pPointDict->setObject(pStr, "x"); } // set y if(std::getline(pointStream, yStr, ',')) { int y = atoi(yStr.c_str()) + (int)objectGroup->getPositionOffset().y; sprintf(buffer, "%d", y); CCString* pStr = new CCString(buffer); pStr->autorelease(); pPointDict->setObject(pStr, "y"); } // add to points array pPointsArray->addObject(pPointDict); pPointDict->release(); } dict->setObject(pPointsArray, "points"); pPointsArray->release(); } }
3.编辑器的UISlider在程序加载初始化时会产生一个内存泄露,cocos2dx version 2.2.1
在GUIReader.cpp的WidgetPropertiesReader0300::setPropsForSliderFromJsonDictionary方法的最后一行加上CC_SAFE_DELETE(progressBarDic);