CCMenu* menu = CCMenu::create(item1, item2, item3, NULL); // create menu with three items menu->alignItemsHorizontallyWithPadding(20.0f); // align items horizontally with 20px spacing
CCMenu* menu = CCMenu::create(item1, item2, item3, NULL); // create menu with three items menu->alignItemsHorizontallyWithPadding(-10.0f); // align items horizontally with -10px spacing (overlapping)In this example, we create a CCMenu object with three CCMenuItem objects, and then call the alignItemsHorizontallyWithPadding() method on the menu, passing in a negative padding value of -10.0f. This causes the items to overlap rather than being spaced apart. Package or library Name: Cocos2d-x C++ library