cocos2d-x图层相关 锚点

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图层相关 锚点

上一篇:hdu 4690 EBCDIC


下一篇:arcmap Command