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

Method createStat

Source/GarageLayer.cpp:169–185  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

167}
168
169void GarageLayer::createStat(const char* sprite, const char* statKey)
170{
171 const auto& size = Director::getInstance()->getWinSize();
172
173 auto stat = Sprite::createWithSpriteFrameName(sprite);
174 stat->setScale(.65);
175 stat->setPosition({size.width - 20, size.height - 14 - 20 * _stats});
176 this->addChild(stat);
177
178 auto statL = Label::createWithBMFont(GameToolbox::getTextureString("bigFont.fnt"), "0"); // GameStatsManager::sharedState()->getStat(statKey)
179 statL->setScale(.45);
180 statL->setAnchorPoint({1, 0});
181 statL->setPosition({stat->getPositionX() - 16, stat->getPositionY() - 7});
182 this->addChild(statL);
183
184 _stats++;
185}
186
187void GarageLayer::setupIconSelect()
188{

Callers 1

initMethod · 0.95

Calls 2

setScaleMethod · 0.80
setPositionMethod · 0.80

Tested by

no test coverage detected