CCLayerColor* ccc =
CCLayerColor::create(ccc4(255,0,0,255));
ccc->setContentSize(CCSize(200,200));
CCLog("anchor<<%f<<%f",ccc->getAnchorPoint().x,ccc->getAnchorPoint().y);
ccc->ignoreAnchorPointForPosition(false);//设置false后有效
ccc->setPosition(ccp(getContentSize().width/2,getContentSize().height/2));
this->addChild(ccc);
CCSprite* sp =
CCSprite::create("CloseNormal.png");
sp->setPosition(ccp(10,10));
ccc->addChild(sp);
运行效果:
cocos2d-x图层相关 锚点,布布扣,bubuko.com
原文:http://www.cnblogs.com/xxhong/p/3592410.html