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

Method popSceneWithTransition

Source/GameToolbox/nodes.cpp:38–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36}
37
38void GameToolbox::popSceneWithTransition(float duration, popTransition type) {
39 auto dir = AltDirector::getInstance();
40
41 if (dir->getRunningScene() != nullptr) {
42 dir->popScene();
43
44 unsigned int c = dir->getScenesStack().size();
45 if (c == 0) dir->end();
46 else {
47 dir->setSendCleanupToScene(true);
48 auto scene = dir->getScenesStack().back();
49
50 switch (type) {
51 case popTransition::kTransitionShop:
52 dir->replaceScene(TransitionMoveInB::create(duration, scene)); // i will change this transition later / att: Sai
53 break;
54 default:
55 dir->replaceScene(TransitionFade::create(duration, scene));
56 break;
57 }
58 }
59 }
60}
61
62// no more "GameToolbox::getTextureString" in Label::createWithBMFont
63Label* GameToolbox::createBMFont(std::string text, std::string font, int width, TextHAlignment alignment) {

Callers

nothing calls this directly

Calls 5

createFunction · 0.85
sizeMethod · 0.80
getScenesStackMethod · 0.80
endMethod · 0.80
setSendCleanupToSceneMethod · 0.80

Tested by

no test coverage detected