Skip to content

Commit

Permalink
Fix PauseLayer misalignments on different aspect ratios
Browse files Browse the repository at this point in the history
  • Loading branch information
Cvolton committed Feb 6, 2024
1 parent 2ac6d72 commit 6a61f91
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/PauseLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ CCNode* getChildBySpriteFrameName(CCNode* parent, const char* name) {
idx += 1;

if(auto practiceTxt = getChildBySpriteFrameName(this, "GJ_practiceTxt_001.png")) {
practiceTxt->setID("practice-text");
practiceTxt->setID("practice-arrow-text");
idx += 1;
}

Expand Down Expand Up @@ -109,8 +109,8 @@ CCNode* getChildBySpriteFrameName(CCNode* parent, const char* name) {
->setCrossAxisOverflow(false)
);
leftMenu->setID("left-button-menu");
leftMenu->setPosition({(winSize.width / 2) - 240.f, (winSize.height / 2)});
leftMenu->setContentSize({40, 280});
leftMenu->setPosition({36.f, (winSize.height / 2)});
leftMenu->setContentSize({40, winSize.height - 40.f});
leftMenu->setZOrder(10);
this->addChild(leftMenu);

Expand All @@ -123,8 +123,8 @@ CCNode* getChildBySpriteFrameName(CCNode* parent, const char* name) {
->setCrossAxisOverflow(false)
);
rightMenu->setID("right-button-menu");
rightMenu->setPosition({(winSize.width / 2) + 240.f, (winSize.height / 2)});
rightMenu->setContentSize({40, 280});
rightMenu->setPosition({winSize.width - 36.f, (winSize.height / 2)});
rightMenu->setContentSize({40, winSize.height - 40.f});
rightMenu->setZOrder(10);
this->addChild(rightMenu);

Expand All @@ -136,7 +136,7 @@ CCNode* getChildBySpriteFrameName(CCNode* parent, const char* name) {
->setCrossAxisOverflow(false)
);
bottomMenu->setID("bottom-button-menu");
bottomMenu->setPosition({(winSize.width / 2), (winSize.height / 2) - 130.f});
bottomMenu->setPosition({(winSize.width / 2), 30.f});
bottomMenu->setContentSize({400, 30});
bottomMenu->setZOrder(10);
this->addChild(bottomMenu);
Expand Down

0 comments on commit 6a61f91

Please sign in to comment.