标签:
解释:
bool CCMenu::initWithArray(CCArray* pArrayOfItems)
{
if (CCLayer::init())
{
// menu in the center of the screen
CCSize 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,位置在屏幕中间。
标签:
原文地址:http://blog.csdn.net/tianxiawuzhei/article/details/44488275