cocos2d x 3.3 button的TouchEventType 怎么获得
1 回答
LEATH
TA贡献1936条经验 获得超6个赞
void UIButtonTest_Editor::touchEvent(Ref *pSender, Widget::TouchEventType type)
{
switch (type)
{
case Widget::TouchEventType::BEGAN:
_displayValueLabel->setString("Touch Down");
break;
case Widget::TouchEventType::MOVED:
_displayValueLabel->setString("Touch Moved");
break;
case Widget::TouchEventType::ENDED:
_displayValueLabel->setString("Touch Ended");
break;
case Widget::TouchEventType::CANCELED:
_displayValueLabel->setString("Touch Canceled");
break;
default:
break;
}
}
- 1 回答
- 0 关注
- 1234 浏览
添加回答
举报
0/150
提交
取消