From 80632e0dcfaece93c717f0cac8530c8e5b20b722 Mon Sep 17 00:00:00 2001 From: "Jill \"oatmealine\" Monoids" Date: Sun, 4 Feb 2024 18:00:48 +0300 Subject: [PATCH] fix overflow in info popup --- src/NLWInfoPopupLayer.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/NLWInfoPopupLayer.cpp b/src/NLWInfoPopupLayer.cpp index a0f92c7..7e280b2 100644 --- a/src/NLWInfoPopupLayer.cpp +++ b/src/NLWInfoPopupLayer.cpp @@ -24,6 +24,8 @@ 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"); @@ -31,17 +33,20 @@ bool NLWInfoPopupLayer::setup(GJGameLevel* level, NLWRating* rating) { 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 };