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

Method showLayer

Source/DropDownLayer.cpp:101–119  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

99}
100
101void DropDownLayer::showLayer(bool attachToScene, bool bounce)
102{
103 const auto& winSize = Director::getInstance()->getWinSize();
104
105 this->runAction(FadeTo::create(0.5, 125));
106 if (!bounce) this->_dropLayer->runAction(EaseInOut::create(MoveTo::create(0.5f, {this->getPositionX(), 0}), 2));
107 else this->_dropLayer->runAction(EaseBounceOut::create(MoveTo::create(1.f, {this->getPositionX(), 0})));
108
109 if (attachToScene)
110 {
111 auto scene = Director::getInstance()->getRunningScene();
112 scene->addChild(this, 100);
113 }
114
115 GameToolbox::onKeyDown(true, this, [this](ax::EventKeyboard::KeyCode keyCode, ax::Event*)
116 {
117 if (keyCode == ax::EventKeyboard::KeyCode::KEY_ESCAPE) hideLayer();
118 });
119}
120
121void DropDownLayer::hideLayer()
122{

Callers 4

initMethod · 0.80
initMethod · 0.80
initMethod · 0.80
initMethod · 0.80

Calls 1

createFunction · 0.85

Tested by

no test coverage detected