MCPcopy Create free account
hub / github.com/GlobedGD/globed2 / init

Method init

src/modules/ui/hooks/LevelSelectLayer.cpp:20–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18class PlayerCountLabel : public CCNode {
19public:
20 bool init(bool compressed) {
21 if (!CCNode::init()) return false;
22
23 this->compressed = compressed;
24
25 if (compressed) {
26 this->setLayout(RowLayout::create()->setGap(3.f));
27 this->setContentWidth(100.f);
28
29 Build<CCLabelBMFont>::create("", "bigFont.fnt")
30 .parent(this)
31 .store(label);
32
33 Build<CCSprite>::create("icon-person.png"_spr)
34 .parent(this)
35 .store(icon);
36 } else {
37 Build<CCLabelBMFont>::create("", "bigFont.fnt")
38 .parent(this)
39 .store(label);
40 }
41
42 return true;
43 }
44
45 void updateCount(size_t players) {
46 if (players == 0) {

Callers 1

createMethod · 0.45

Calls 1

initFunction · 0.70

Tested by

no test coverage detected