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

Method onEnter

tests/cpp-tests/Source/LayerTest/LayerTest.cpp:79–108  ·  view source on GitHub ↗

LayerTestCascadingOpacityA

Source from the content-addressed store, hash-verified

77
78// LayerTestCascadingOpacityA
79void LayerTestCascadingOpacityA::onEnter()
80{
81 LayerTest::onEnter();
82
83 auto s = Director::getInstance()->getWinSize();
84 auto layer1 = Layer::create();
85
86 auto sister1 = Sprite::create("Images/grossinis_sister1.png");
87 auto sister2 = Sprite::create("Images/grossinis_sister2.png");
88 auto label = Label::createWithBMFont("fonts/bitmapFontTest.fnt", "Test");
89
90 layer1->addChild(sister1);
91 layer1->addChild(sister2);
92 layer1->addChild(label);
93 this->addChild(layer1, 0, kTagLayer);
94
95 sister1->setPosition(Vec2(s.width * 1 / 3, s.height / 2));
96 sister2->setPosition(Vec2(s.width * 2 / 3, s.height / 2));
97 label->setPosition(Vec2(s.width / 2, s.height / 2));
98
99 layer1->runAction(RepeatForever::create(
100 Sequence::create(FadeTo::create(4, 0), FadeTo::create(4, 255), DelayTime::create(1), nullptr)));
101
102 sister1->runAction(
103 RepeatForever::create(Sequence::create(FadeTo::create(2, 0), FadeTo::create(2, 255), FadeTo::create(2, 0),
104 FadeTo::create(2, 255), DelayTime::create(1), nullptr)));
105
106 // Enable cascading in scene
107 setEnableRecursiveCascading(this, true);
108}
109
110std::string LayerTestCascadingOpacityA::subtitle() const
111{

Callers

nothing calls this directly

Calls 15

getInstanceFunction · 0.85
createFunction · 0.85
Color4BFunction · 0.85
getRendererMethod · 0.80
setClearColorMethod · 0.80
Vec2Function · 0.50
Color4FFunction · 0.50
addChildMethod · 0.45

Tested by

no test coverage detected