![ccmenu add child cocos2dx ccmenu add child cocos2dx](https://i.ebayimg.com/images/g/lKsAAOSw7Q1f4i8R/s-l300.jpg)
int heightItem = menuNewGame->getContentSize().height + gapLine.CCMenu inline: var ctor () inline: local CCMenu inline: virtual CCMenu inline virtual: Member Function Documentation. //The sum of the height of a menu item and line spacing But the only accepted children are MenuItem objects Constructor & Destructor Documentation.CCMenuItemImage *menuExit = CCMenuItemImage::create( "Image/button_exit.png", "Image/button_exit_pressed.png", this, menu_selector(LayerMainMenu::exit)) Navigate to a location where you wish to store your Cocos project Open a command window in your parent folder (Cocos CLI will create the actual project directory) Hold down your Shift key, and right-click in the empty white space of the Explorer window.CCMenuItemImage *menuHelp = CCMenuItemImage::create( "Image/button_help.png", "Image/button_help_pressed.png", this, menu_selector(LayerMainMenu::help)).CCMenuItemImage *menuSetting = CCMenuItemImage::create( "Image/button_setting.png", "Image/button_setting_pressed.png", this, menu_selector(LayerMainMenu::setting)).
![ccmenu add child cocos2dx ccmenu add child cocos2dx](https://s3.envato.com/files/264399792/android/ss_android_5.jpg)
CCMenuItemImage *menuContinueGame = CCMenuItemImage::create( "Image/button_continue_game.png", "Image/button_continue_game_pressed.png", this, menu_selector(LayerMainMenu::continueGame)).CCMenuItemImage *menuNewGame = CCMenuItemImage::create( "Image/button_new_game.png", "Image/button_new_game_pressed.png", this, menu_selector(LayerMainMenu::newGame)).spriteName->setPosition(ccp(size.width/2, size.height-150)).CCSprite* spriteName = CCSprite::create( "Image/name_game.png").CCLayerColor *layerColor = CCLayerColor::create(ccc4(0,0,0,50)).//Add the sprite to HelloWorld layer as a child layer.CCMenu::create() //Add Menu addChild(menu) //Create a menu item that. pSprite->setPosition(ccp(size.width/2, size.height/2)) In Cocos2d-X, you can combine menus and actions to achieve menu special effects.CCSize size = CCDirector::sharedDirector()->getWinSize().//Place the sprite on the center of the screen.CCSprite* pSprite = CCSprite::create( "Image/bg_menu.png").