Skip to content

Commit

Permalink
fix overflow in info popup
Browse files Browse the repository at this point in the history
  • Loading branch information
oatmealine committed Feb 4, 2024
1 parent 32865d0 commit 80632e0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/NLWInfoPopupLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,29 @@ bool NLWInfoPopupLayer::setup(GJGameLevel* level, NLWRating* rating) {
name->setPosition(ccp(90, 230));
name->setScale(0.75);
name->setAnchorPoint({ 0.f, 0.5f });
name->setAlignment(CCTextAlignment::kCCTextAlignmentLeft);
name->limitLabelWidth(170.f, 0.75f, 0.1f);
m_mainLayer->addChild(name);

auto creator = CCLabelBMFont::create(("by " + rating->creator).c_str(), "bigFont.fnt");
creator->setPosition(ccp(90, 204));
creator->setScale(0.75);
creator->setAnchorPoint({ 0.f, 0.5f });
creator->setAlignment(CCTextAlignment::kCCTextAlignmentLeft);
creator->limitLabelWidth(195.f, 0.75f, 0.1f);
m_mainLayer->addChild(creator);

auto tier = CCLabelBMFont::create((rating->type == NLWRatingType::Pending ? rating->tier : (rating->tier + " Tier")).c_str(), "bigFont.fnt");
tier->setPosition(ccp(385, 230));
tier->setScale(0.75);
tier->setColor(ListManager::getTierColor(rating->tier));
tier->limitLabelWidth(180.f, 0.75f, 0.1f);
m_mainLayer->addChild(tier);

auto skillset = CCLabelBMFont::create(rating->skillset.c_str(), "bigFont.fnt");
skillset->setPosition(ccp(385, 204));
skillset->setScale(0.5);
skillset->limitLabelWidth(180.f, 0.5f, 0.1f);
m_mainLayer->addChild(skillset);

auto const descSize = CCSize { 380.f, 70.f };
Expand Down

0 comments on commit 80632e0

Please sign in to comment.