Label *label1 = Label::createWithTTF("Start Game","fonts/HippopotamusApocalypse-Gzly.ttf", 70);
Label *label2 = Label::createWithTTF("Options","fonts/HippopotamusApocalypse-Gzly.ttf", 70);
Label *label3 = Label::createWithTTF("Quit","fonts/HippopotamusApocalypse-Gzly.ttf", 70);
MenuItemFont::setFontSize(40);
auto menuItemFirst = MenuItemLabel::create(label1, CC_CALLBACK_0(HelloWorld::loadLevel, this, currentLevel));
auto menuItemSecond = MenuItemLabel::create(label2, CC_CALLBACK_1(HelloWorld::secondMenuButtonTapped, this));
auto menuItemThird = MenuItemLabel::create(label3, CC_CALLBACK_1(HelloWorld::menuCloseCallback, this));
menuCenter = Menu::create(menuItemFirst,menuItemSecond,menuItemThird, NULL);
menuCenter->setPosition(Vec2(origin.x + visibleSize.width/2 , origin.y + visibleSize.height/2 ));
menuCenter->alignItemsVerticallyWithPadding(90);
I created menu with this piece of code.This works if I dont move my container “this” node. I am using custom very simple camera follow to follow my character.
Doing this I just only move “this” node to up/down by this->setPosition(…). But when open menu node it doesnt displayed on screen, but when I click region of menu items callbacks run of that menu item.
when I change position of menu this time I can see menu but this time its unclickable!
How can I fix this? Currenly menu class is unusable if you move your screen or I am missing something.