// CCNode 的添加 与tag// 1 添加子类函数 // CCLayer*layer =CCLayer::create();// layer->setPosition(ccp(240,200));// CCSprite*sprChild = CCSprite::create("Icon.png");// layer->addChild(sprChild);// addChild(layer);//// CCSprite* spr = CCSprite::create("Icon.png");// spr->setPosition(ccp(100,100));// CCLayerColor* layerChild = CCLayerColor::create(ccc4(255, 0, 0, 255),50,50);// spr->addChild(layerChild);// addChild(spr); //------Tag的作用与使用// CCSprite* spY = CCSprite::create("Icon.png");// spY->setPosition(ccp(100,200));// addChild(spY);////// CCSprite * spr11 = CCSprite::create("Icon.png");// spr11->setPosition(ccp(200,200));// addChild(spr11,0,823);// this->testSprite(); //-------坐标系// CCSprite * spr =CCSprite::create("Icon.png");// spr->setPosition(ccp(100,100));// addChild(spr);//// CCSprite*spr2 = CCSprite::create("Icon.png");// spr2->setPosition(ccp(200,200));// addChild(spr2);// //-------锚点// CCSprite* sp1 = CCSprite::create("Icon.png");// addChild(sp1);// // sp1->setAnchorPoint(ccp(0,0));// sp1->setPosition(ccp(sp1->getContentSize().width*0.5,sp1->getContentSize().height*0.5));// return true; // //layer 默认充满屏幕// CCLayerColor* layer = CCLayerColor::create(ccc4(255, 0, 0, 255));// addChild(layer);// CCLOG("%f,%f",layer->getAnchorPoint().x,layer->getAnchorPoint().y);// CCLOG("%f,%f",layer->getPositionX(),layer->getPositionY());// CCLOG("%f,%f",layer->getContentSize().width,layer->getContentSize().height); //-------Z轴与遮盖关系 CCSprite* spA1 =CCSprite::create("Icon.png"); spA1->setPosition(ccp(150,200)); addChild(spA1); CCSprite* spA2 =CCSprite::create("Icon.png"); spA2->setPosition(ccp(100,200)); spA2->setScale(2); addChild(spA2); CCSprite* spB1 =CCSprite::create("Icon.png"); spB1->setPosition(ccp(380,140)); addChild(spB1,1); CCSprite* spB2 =CCSprite::create("Icon.png"); spB2->setPosition(ccp(330,140)); spB2->setScale(2); addChild(spB2);