不设置前可以在屏幕显示,设置后就消失了。
starSprite.push_back(Sprite::createWithTexture(Director::getInstance()->getTextureCache()->getTextureForKey(".//GamingScene//1_0//aroundStar.png"))); starSprite.back()->setContentSize(Size(10, 10)); starSprite.back()->setAnchorPoint( rootnode->getChildByTag(1)->getPosition() ); starSprite.back()->setVisible(true); starSprite.back()->setPosition(300,300 ); //starSprite.back()->runAction(RepeatForever::create(RotateBy::create(2, 360))); auto x = starSprite.back()->getAnchorPoint().x; auto y = starSprite.back()->getAnchorPoint().y; auto xx = rootnode->getChildByTag(1)->getPosition().x; auto yy = rootnode->getChildByTag(1)->getPosition().y; auto xxx = starSprite.back()->getPosition().x; auto yyy = starSprite.back()->getPosition().y; addChild(starSprite.back());
帖子: 6
参与者: 1