标签:style blog http os io 2014 ar cti
1、引入这个类:require "GuiConstants"
2、下面是回调函数的处理.
local function menuZhuCeCallback(sender,eventType)
print(sender:getTag())
if eventType == ccui.TouchEventType.began then
print("按下按钮")
elseif eventType == ccui.TouchEventType.moved then
print("按下按钮移动")
elseif eventType == ccui.TouchEventType.ended then
print("放开按钮")
elseif eventType == ccui.TouchEventType.canceled then
print("取消点击")
end
end
3 、对button事件的调用处理。获得button对象
local button_close=mianye:getChildByTag(4);
button_close:addTouchEventListener(menuZhuCeCallback)
lua 中处理cocos2dx 的button 事件,布布扣,bubuko.com
标签:style blog http os io 2014 ar cti
原文地址:http://www.cnblogs.com/lifesteven/p/3907786.html