| 938 | } |
| 939 | |
| 940 | void SpriteBatchNodeReorderIssue767::reorderSprites(float dt) |
| 941 | { |
| 942 | auto spritebatch = static_cast<SpriteBatchNode*>(getChildByTag(kTagSprite1)); |
| 943 | auto father = static_cast<Sprite*>(spritebatch->getChildByTag(kTagSprite2)); |
| 944 | auto left = static_cast<Sprite*>(father->getChildByTag(kTagSpriteLeft)); |
| 945 | auto right = static_cast<Sprite*>(father->getChildByTag(kTagSpriteRight)); |
| 946 | |
| 947 | int newZLeft = 1; |
| 948 | |
| 949 | if (left->getLocalZOrder() == 1) |
| 950 | newZLeft = -1; |
| 951 | |
| 952 | father->reorderChild(left, newZLeft); |
| 953 | father->reorderChild(right, -newZLeft); |
| 954 | } |
| 955 | |
| 956 | //------------------------------------------------------------------ |
| 957 | // |
nothing calls this directly
no test coverage detected