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

Method SceneTestLayer2

tests/cpp-tests/Source/SceneTest/SceneTest.cpp:124–147  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

122//------------------------------------------------------------------
123
124SceneTestLayer2::SceneTestLayer2()
125{
126 _timeCounter = 0;
127
128 auto item1 = MenuItemFont::create("replaceScene", AX_CALLBACK_1(SceneTestLayer2::onReplaceScene, this));
129 auto item2 =
130 MenuItemFont::create("replaceScene w/transition", AX_CALLBACK_1(SceneTestLayer2::onReplaceSceneTran, this));
131 auto item3 = MenuItemFont::create("Go Back", AX_CALLBACK_1(SceneTestLayer2::onGoBack, this));
132
133 auto menu = Menu::create(item1, item2, item3, nullptr);
134 menu->alignItemsVertically();
135
136 addChild(menu);
137
138 auto s = Director::getInstance()->getWinSize();
139 auto sprite = Sprite::create(s_pathGrossini);
140 addChild(sprite);
141 sprite->setPosition(Vec2(s.width - 40, s.height / 2));
142 auto rotate = RotateBy::create(2, 360);
143 auto repeat = RepeatForever::create(rotate);
144 sprite->runAction(repeat);
145
146 schedule(AX_SCHEDULE_SELECTOR(SceneTestLayer2::testDealloc));
147}
148
149void SceneTestLayer2::testDealloc(float dt)
150{

Callers

nothing calls this directly

Calls 6

createFunction · 0.85
getInstanceFunction · 0.85
alignItemsVerticallyMethod · 0.80
Vec2Function · 0.50
setPositionMethod · 0.45
runActionMethod · 0.45

Tested by

no test coverage detected