MenuItemImage doesn't show up [Solved]

Hi everyone! I’m making a Main Menu for my game and I need some help with Play Button.
The compiler doesn’t return errors but at Runtime my button doesn’t even show up.
Here’s my code:

auto play = MenuItemImage::create("play.png", "playSelected.png", SEL_CallFunc(&MainMenu::gotoLevels));
play->setPosition(Vec2(visibleSize.width / 2 + origin.x, visibleSize.height + origin.y));
    
auto mainmenu = Menu::create(play, nullptr);
this->addChild(mainmenu, 2);

I would be so happy if you guys helped me (I’m not a skilled c++ coder :/).
Thank you in advance!

try this:

mainmenu->setPosition(Vec2::ZERO);
1 Like

It worked perfectly! Thank you so much! :smile: