mirror of https://github.com/axmolengine/axmol.git
Merge pull request #13297 from yangws/bug_21861
Fix bug: #21861 cpp-tests->Node:Sprite->Testing Sprite BatchNode's ef…
This commit is contained in:
commit
5fb0135bc2
|
@ -675,15 +675,24 @@ std::string SpriteBatchNodeReorderIssue744::subtitle() const
|
||||||
|
|
||||||
Sprite* SpriteBatchNodeReorderIssue766::makeSpriteZ(int aZ)
|
Sprite* SpriteBatchNodeReorderIssue766::makeSpriteZ(int aZ)
|
||||||
{
|
{
|
||||||
auto sprite = Sprite::createWithTexture(batchNode->getTexture(), Rect(128,0,64,64));
|
Rect rcw(128,0,64,64);
|
||||||
|
rcw = CC_RECT_PIXELS_TO_POINTS(rcw);
|
||||||
|
auto sprite = Sprite::createWithTexture(batchNode->getTexture(), rcw);
|
||||||
|
sprite->setScale(CC_CONTENT_SCALE_FACTOR());
|
||||||
batchNode->addChild(sprite, aZ+1, 0);
|
batchNode->addChild(sprite, aZ+1, 0);
|
||||||
|
|
||||||
//children
|
//children
|
||||||
auto spriteShadow = Sprite::createWithTexture(batchNode->getTexture(), Rect(0,0,64,64));
|
Rect rc1(0,0,64,64);
|
||||||
|
rc1 = CC_RECT_PIXELS_TO_POINTS(rc1);
|
||||||
|
auto spriteShadow = Sprite::createWithTexture(batchNode->getTexture(), rc1);
|
||||||
spriteShadow->setOpacity(128);
|
spriteShadow->setOpacity(128);
|
||||||
|
sprite->setScale(CC_CONTENT_SCALE_FACTOR());
|
||||||
sprite->addChild(spriteShadow, aZ, 3);
|
sprite->addChild(spriteShadow, aZ, 3);
|
||||||
|
|
||||||
auto spriteTop = Sprite::createWithTexture(batchNode->getTexture(), Rect(64,0,64,64));
|
Rect rc2(64,0,64,64);
|
||||||
|
rc2 = CC_RECT_PIXELS_TO_POINTS(rc2);
|
||||||
|
auto spriteTop = Sprite::createWithTexture(batchNode->getTexture(), rc2);
|
||||||
|
sprite->setScale(CC_CONTENT_SCALE_FACTOR());
|
||||||
sprite->addChild(spriteTop, aZ+2, 3);
|
sprite->addChild(spriteTop, aZ+2, 3);
|
||||||
|
|
||||||
return sprite;
|
return sprite;
|
||||||
|
|
Loading…
Reference in New Issue