fix some ui positioning

This commit is contained in:
ConfiG 2024-06-20 15:26:09 +03:00
parent c3058ff452
commit e273ef27b6
No known key found for this signature in database
GPG key ID: 44DA1983F524C11B
2 changed files with 7 additions and 3 deletions
loader
resources
src/ui/mods

Binary file not shown.

Before

(image error) Size: 6.3 KiB

After

(image error) Size: 6 KiB

View file

@ -395,23 +395,27 @@ bool ModsLayer::init() {
auto tabsTop = CCSprite::createWithSpriteFrameName(geodeTheme ? "mods-list-top.png"_spr : "mods-list-top-gd.png"_spr);
tabsTop->setID("frame-top-sprite");
tabsTop->setAnchorPoint({ .5f, .0f });
tabsTop->setZOrder(2);
m_frame->addChildAtPosition(tabsTop, Anchor::Top, ccp(0, -2));
auto tabsLeft = CCSprite::createWithSpriteFrameName(geodeTheme ? "mods-list-side.png"_spr : "mods-list-side-gd.png"_spr);
tabsLeft->setID("frame-left-sprite");
tabsLeft->setScaleY(m_frame->getContentHeight() / tabsLeft->getContentHeight());
m_frame->addChildAtPosition(tabsLeft, Anchor::Left, ccp(6, 0));
tabsLeft->setZOrder(1);
m_frame->addChildAtPosition(tabsLeft, Anchor::Left, ccp(6.5f, 1));
auto tabsRight = CCSprite::createWithSpriteFrameName(geodeTheme ? "mods-list-side.png"_spr : "mods-list-side-gd.png"_spr);
tabsRight->setID("frame-right-sprite");
tabsRight->setFlipX(true);
tabsRight->setScaleY(m_frame->getContentHeight() / tabsRight->getContentHeight());
m_frame->addChildAtPosition(tabsRight, Anchor::Right, ccp(-6, 0));
tabsRight->setZOrder(1);
m_frame->addChildAtPosition(tabsRight, Anchor::Right, ccp(-6.5f, 1));
auto tabsBottom = CCSprite::createWithSpriteFrameName(geodeTheme ? "mods-list-bottom.png"_spr : "mods-list-bottom-gd.png"_spr);
tabsBottom->setID("frame-bottom-sprite");
tabsBottom->setAnchorPoint({ .5f, 1.f });
m_frame->addChildAtPosition(tabsBottom, Anchor::Bottom, ccp(0, 2));
tabsBottom->setZOrder(2);
m_frame->addChildAtPosition(tabsBottom, Anchor::Bottom, ccp(0, 3));
this->addChildAtPosition(m_frame, Anchor::Center, ccp(0, -10), false);