Quantcast
Channel: Cocos中文社区 - 最新主题
Viewing all articles
Browse latest Browse all 88737

设置锚点后精灵消失

$
0
0

@xubaoyu12gmail.com 写道:

不设置前可以在屏幕显示,设置后就消失了。

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

阅读整个主题


Viewing all articles
Browse latest Browse all 88737

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>