标签:class blog code ext get width
#include "cocos2d.h" #include "cocos-ext.h" USING_NS_CC; USING_NS_CC_EXT; using namespace ui; UIButton *button = UIButton::create(); button->setTouchEnabled(true); button->loadTextures("close1.png", "close2.png",""); //按钮纹理 button->setPosition(ccp(visibleSize.width/2, visibleSize.height/2)); button->addTouchEventListener(this, toucheventselector(HelloWorld::touchEvent));//按钮的事件 m_pUiLayer = UILayer::create(); //创建一个UI层 m_pUiLayer->addWidget(button);//添加画布 this->addChild(m_pUiLayer); void HelloWorld::touchEvent(CCObject *pSender, TouchEventType type) { CCLOG("test..."); }
标签:class blog code ext get width
原文地址:http://blog.csdn.net/oyangyufu/article/details/31792795