UIButton* pButton=dynamic_cast<UIButton*>(m_UILayout->getChildByName("Button_49"));
pButton->addTouchEventListener(this,toucheventselector(GameLayer::callback_menu));
pButton->setTouchEnabled(true);
这个按钮 是找到了 就是不响应
UIButton* pButton=dynamic_cast<UIButton*>(m_UILayout->getChildByName("Button_49"));
pButton->addTouchEventListener(this,toucheventselector(GameLayer::callback_menu));
pButton->setTouchEnabled(true);
这个按钮 是找到了 就是不响应
cocostudio里打开交互 , 还有可能这个层上面有一个透明的层。
建意使用Button 更替 UIButton
我交互点了 但是 还是不行啊
上一个版本的 我这样 还是可以的啊
检查下别的控件的尺寸,BUTTON的上层应该被遮挡
xiexie:877::877::877:
你看看你的UI是添加到CCLayer还是添加到UILayer(TouchGroup)的?
谢谢 :877::877:
typedef cocos2d::gui::Button UIButton;
弱弱的问一句,Button和UIButton 有啥区别么?为啥要更替
哪天typedef没了你就得后悔了……
UIbutton和ios原生控件存在名称冲突,遂解决替换,目前做别名是为了过渡,但以后应该就是button了。
这个一个过渡方案,请大家尽量使用新得没有UI开头的~
原来是这样