关于覆盖问题 setZorder
#include "T03LayerZorder.h"
CCScene * T03LayerZorder::scene()
{
CCScene * scene = CCScene::create();
T03LayerZorder * layer = T03LayerZorder::create();
scene->addChild(layer);
return scene;
}
bool T03LayerZorder::init()
{
if (!CCLayer::init())
{
return false;
}
CCSprite * man = CCSprite::create("zorder/man.png");
man->setPosition(ccp(240-40, 160-20));
man->setScale(0.3);
addChild(man);
man->setZOrder(12);
CCSprite * woman = CCSprite::create("zorder/woman.png");
woman->setPosition(ccp(240, 160));
woman->setScale(0.3);
addChild(woman);
woman->setZOrder(10);
CCSprite * another = CCSprite::create("zorder/another.png");
another->setPosition(ccp(240+40, 160+20));
another->setScale(0.3);
addChild(another);
another->setZOrder(5);
return true;
}