Skip to content

Instantly share code, notes, and snippets.

@ryohey
Last active April 20, 2016 05:48
Show Gist options
  • Select an option

  • Save ryohey/8591621 to your computer and use it in GitHub Desktop.

Select an option

Save ryohey/8591621 to your computer and use it in GitHub Desktop.
create MenuItemLabel in cocos2d-x v3.0beta0
auto item1 = MenuItemLabel::create(LabelTTF::create("[$200]", "Courier New.ttf", 51),
[](Object *obj) {
CCLOG("item1 touched");
});
auto item2 = MenuItemLabel::create(LabelTTF::create("[$500]", "Courier New.ttf", 51),
[](Object *obj) {
CCLOG("item2 touched");
}
});
Menu *menu = Menu::create(item1, item2, NULL);
menu->alignItemsHorizontallyWithPadding(10);
addChild(menu);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment