------------------------------------------------------------------ Slice9 Test #10 ------------------------------------------------------------------
| 5798 | // |
| 5799 | //------------------------------------------------------------------ |
| 5800 | SpriteSlice9Test10::SpriteSlice9Test10() |
| 5801 | { |
| 5802 | Size s = Director::getInstance()->getVisibleSize(); |
| 5803 | |
| 5804 | SpriteFrameCache::getInstance()->addSpriteFramesWithFile("Images/blocks9ss.plist"); |
| 5805 | |
| 5806 | auto s1 = Sprite::createWithSpriteFrameName("blocks9ss/blocks9r.png"); |
| 5807 | addChild(s1); |
| 5808 | s1->setPosition(s.width / 2 - s.width / 3, s.height / 2); |
| 5809 | s1->setAnchorPoint(Vec2::ANCHOR_MIDDLE); |
| 5810 | s1->setCenterRectNormalized(Rect(1 / 3.f, 1 / 3.f, 1 / 3.f, 1 / 3.f)); |
| 5811 | s1->setContentSize(s1->getContentSize() * 1.5); |
| 5812 | s1->setFlippedX(true); |
| 5813 | |
| 5814 | auto s2 = Sprite::createWithSpriteFrameName("blocks9ss/blocks9r.png"); |
| 5815 | addChild(s2); |
| 5816 | s2->setPosition(s.width * 2 / 4, s.height / 2); |
| 5817 | s2->setAnchorPoint(Vec2::ANCHOR_MIDDLE); |
| 5818 | s2->setCenterRectNormalized(Rect(1 / 3.f, 1 / 3.f, 1 / 3.f, 1 / 3.f)); |
| 5819 | s2->setContentSize(s2->getContentSize() * 1.5); |
| 5820 | |
| 5821 | // Create reference sprite that's rotating based on there anchor point |
| 5822 | auto s3 = Sprite::createWithSpriteFrameName("blocks9ss/blocks9r.png"); |
| 5823 | addChild(s3); |
| 5824 | s3->setPosition(s.width / 2 + s.width / 3, s.height / 2); |
| 5825 | s3->setAnchorPoint(Vec2::ANCHOR_MIDDLE); |
| 5826 | s3->setCenterRectNormalized(Rect(1 / 3.f, 1 / 3.f, 1 / 3.f, 1 / 3.f)); |
| 5827 | s3->setContentSize(s3->getContentSize() * 1.5); |
| 5828 | s3->setFlippedY(true); |
| 5829 | } |
| 5830 | |
| 5831 | //------------------------------------------------------------------ |
| 5832 | // |
nothing calls this directly
no test coverage detected