MCPcopy Create free account
hub / github.com/axmolengine/axmol / Issue17119

Method Issue17119

tests/cpp-tests/Source/SpriteTest/SpriteTest.cpp:5836–5886  ·  view source on GitHub ↗

------------------------------------------------------------------ Issue 17119 ------------------------------------------------------------------

Source from the content-addressed store, hash-verified

5834//
5835//------------------------------------------------------------------
5836Issue17119::Issue17119() : _accum(0)
5837{
5838 Size s = Director::getInstance()->getVisibleSize();
5839
5840 SpriteFrameCache::getInstance()->addSpriteFramesWithFile("Images/issue_17119.plist");
5841 SpriteFrameCache::getInstance()->addSpriteFramesWithFile("Images/blocks9ss.plist");
5842
5843 auto s1 = Sprite::createWithSpriteFrameName("issue_17119/firstPic.png");
5844 addChild(s1);
5845 s1->setPosition(s.width / 2 - s.width / 3, s.height / 2);
5846 s1->setScale(0.25f);
5847 auto p1 = Sprite::create("Images/r1.png");
5848 p1->setScale(0.25f);
5849 p1->setPosition(s1->getPosition());
5850 addChild(p1, 10);
5851
5852 auto s2 = Sprite::createWithSpriteFrameName("blocks9ss/blocks9r.png");
5853 addChild(s2);
5854 s2->setPosition(s.width / 2, s.height / 2);
5855 s2->setCenterRectNormalized(Rect(1 / 3.f, 1 / 3.f, 1 / 3.f, 1 / 3.f));
5856 s2->setContentSize(s2->getContentSize() * 1.5);
5857 auto p2 = Sprite::create("Images/r1.png");
5858 p2->setScale(0.25f);
5859 p2->setPosition(s2->getPosition());
5860 addChild(p2, 10);
5861
5862 auto s3 = Sprite::create("Images/grossini.png");
5863 addChild(s3);
5864 s3->setPosition(s.width / 2 + s.width / 3, s.height / 2 + s.height / 3);
5865 s3->setContentSize(s3->getContentSize() * 1.5);
5866 auto p3 = Sprite::create("Images/r1.png");
5867 p3->setScale(0.25f);
5868 p3->setPosition(s3->getPosition());
5869 addChild(p3, 10);
5870
5871 auto s4 = Sprite::create("Images/grossini.png");
5872 addChild(s4);
5873 s4->setPosition(s.width / 2 + s.width / 3, s.height / 2 - s.height / 3);
5874 s4->setContentSize(s2->getContentSize() * 1.5);
5875 s4->setStretchEnabled(false);
5876 auto p4 = Sprite::create("Images/r1.png");
5877 p4->setScale(0.25f);
5878 p4->setPosition(s3->getPosition());
5879 addChild(p4, 10);
5880
5881 _s1 = s1;
5882 _s2 = s2;
5883 _s3 = s3;
5884 _s4 = s4;
5885 scheduleUpdate();
5886}
5887
5888void Issue17119::update(float dt)
5889{

Callers

nothing calls this directly

Calls 13

getInstanceFunction · 0.85
createFunction · 0.85
scheduleUpdateFunction · 0.85
setStretchEnabledMethod · 0.80
RectClass · 0.50
getVisibleSizeMethod · 0.45
setPositionMethod · 0.45
setScaleMethod · 0.45
getPositionMethod · 0.45
setContentSizeMethod · 0.45

Tested by

no test coverage detected