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

Method init

Source/CurrencyRewardLayer.cpp:39–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37}
38
39bool CurrencyRewardLayer::init(int orbs, int stars, int diamonds)
40{
41 const auto& winSize = Director::getInstance()->getWinSize();
42
43 Node* dropDownStats = Node::create();
44
45 this->addChild(dropDownStats, 4);
46
47 dropDownStats->setPosition(winSize.width - 40.f, (winSize.height - 5.0f) /*+ param_10*/);
48
49 if (orbs > 0)
50 {
51 auto label = Label::createWithBMFont("bigFont.fnt", fmt::format("{}", 1000)); // replace with GameManager stats
52 label->setScale(2.f); // change this, seems to be related to the size of the window
53 dropDownStats->addChild(label, 10);
54
55 auto sprite = Sprite::createWithSpriteFrameName("currencyOrbIcon_001.png");
56 dropDownStats->addChild(sprite, 3);
57 sprite->setPosition(15.0f, -0.5 /* - local_68.height * 0.5*/);
58
59 auto sequence = Sequence::create(TintTo::create(0.3,0,255,255),TintTo::create(0.3,150,255,255), nullptr);
60 label->runAction(RepeatForever::create(sequence));
61 }
62
63 Vec2 movetoPos; // finish
64
65
66 //dropDownStats->runAction(EaseInOut::create(MoveTo::create(0.5, ??),2.0));
67
68 return true;
69}

Callers 1

createMethod · 0.45

Calls 3

createFunction · 0.85
setPositionMethod · 0.80
setScaleMethod · 0.80

Tested by

no test coverage detected