解释:
bool CCMenu::initWithArray(CCArray* pArrayOfItems){if (CCLayer::init()){// menu in the center of the screenCCSize s = CCDirector::sharedDirector()->getWinSize();this->ignoreAnchorPointForPosition(true);setAnchorPoint(ccp(0.5f, 0.5f));this->setContentSize(s);setPosition(ccp(s.width/2, s.height/2));return true;}return false;}menu忽略锚点(相当于以左下角为锚点),而且初始大小为WinSize,位置在屏幕中间。所以,,我们即使设置锚点,也没有用处。但是可以设置位置和大小。而且不要使用基于menu锚点的坐标计算方法。
战胜困难,走出困境,成功就会属于你。