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

Method SceneTestLayer1

tests/cpp-tests/Source/SceneTest/SceneTest.cpp:50–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48};
49
50SceneTestLayer1::SceneTestLayer1()
51{
52 auto item1 = MenuItemFont::create("Test pushScene", AX_CALLBACK_1(SceneTestLayer1::onPushScene, this));
53 auto item2 =
54 MenuItemFont::create("Test pushScene w/transition", AX_CALLBACK_1(SceneTestLayer1::onPushSceneTran, this));
55 auto item3 = MenuItemFont::create("Quit", AX_CALLBACK_1(SceneTestLayer1::onQuit, this));
56
57 auto menu = Menu::create(item1, item2, item3, nullptr);
58 menu->alignItemsVertically();
59
60 addChild(menu);
61
62 auto s = Director::getInstance()->getWinSize();
63 auto sprite = Sprite::create(s_pathGrossini);
64 addChild(sprite);
65 sprite->setPosition(Vec2(s.width - 40, s.height / 2));
66 auto rotate = RotateBy::create(2, 360);
67 auto repeat = RepeatForever::create(rotate);
68 sprite->runAction(repeat);
69
70 schedule(AX_SCHEDULE_SELECTOR(SceneTestLayer1::testDealloc));
71}
72
73void SceneTestLayer1::testDealloc(float dt)
74{

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