您好,请参考testcpp中的GUI示例,
button创建方法:
// Create the button
UIButton* button = UIButton::create();
button->setTouchEnabled(true);
button->loadTextures("cocosgui/animationbuttonnormal.png", "cocosgui/animationbuttonpressed.png", "");
button->setPosition(ccp(widgetSize.width / 2.0f, widgetSize.height / 2.0f));
button->addTouchEventListener(this, toucheventselector(UIButtonTest::touchEvent));
m_pUiLayer->addWidget(button);