MCPcopy Create free account
hub / github.com/Open-GD/OpenGD / show

Method show

Source/PopupLayer.cpp:36–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34USING_NS_AX;
35
36void PopupLayer::show(Transitions transitions)
37{
38 //robtops system to add to highest z
39 auto scene = Director::getInstance()->getRunningScene();
40 int z = GameToolbox::getHighestChildZ(scene);
41 if(z <= 104)
42 z = 105;
43 else
44 z++;
45
46 scene->addChild(this, z);
47 this->setOpacity(0);
48
49 switch (transitions)
50 {
51 case kNone:
52 break;
53 default:
54 this->_mainLayer->setScale(0.1f);
55 this->_mainLayer->runAction(EaseElasticOut::create(ScaleTo::create(0.5f, 1.0f), 0.6f));
56 }
57 this->runAction(FadeTo::create(0.14, 150));
58
59 GameToolbox::onKeyDown(true, this, [this](EventKeyboard::KeyCode code, Event*)
60 {
61 GameToolbox::log("key down popup: {}", static_cast<int>(code));
62 switch(code)
63 {
64 case EventKeyboard::KeyCode::KEY_BACK:
65 close();
66 default:
67 break;
68 }
69 });
70}
71
72bool PopupLayer::init()
73{

Callers 7

initMethod · 0.80
initMethod · 0.80
initMethod · 0.80
initMethod · 0.80
initMethod · 0.80
onDownloadFailedMethod · 0.80
onChestClickedMethod · 0.80

Calls 4

createFunction · 0.85
logFunction · 0.85
setOpacityMethod · 0.80
setScaleMethod · 0.80

Tested by

no test coverage detected