new Ycc.Listener()
事件监听类。供Layer及UI类继承
Members
-
disableTypeObject
-
被禁用的事件类型。key为type,val为boolean
-
listenersObject
-
所有的监听器。key为type,val为listener数组。
-
onclickfunction
-
点击 的监听。默认为null
-
ondragendfunction
-
拖拽结束 的监听。默认为null
-
ondraggingfunction
-
拖拽 的监听。默认为null
-
ondragstartfunction
-
拖拽开始 的监听。默认为null
-
onmousedownfunction
-
鼠标按下 的监听。默认为null
-
onmousemovefunction
-
鼠标移动 的监听。默认为null
-
onmouseoutfunction
-
鼠标移出 的监听。默认为null
-
onmouseoverfunction
-
鼠标移入 的监听。默认为null
-
onmouseupfunction
-
鼠标抬起 的监听。默认为null
-
ontapfunction
-
点击事件 的监听。默认为null
-
ontouchendfunction
-
触摸结束 的监听。默认为null
-
ontouchmovefunction
-
触摸移动 的监听。默认为null
-
ontouchstartfunction
-
触摸开始 的监听。默认为null
-
stopAllEventboolean
-
只会阻止当前UI事件的触发,不会阻止其下面子元素事件的触发
-
stopTypeObject
-
被阻止的事件类型。key为type,val为boolean
Methods
-
staticYcc.Listener.release(listener)
-
释放某个监听器的内存 将其所有引用属性设为null,等待GC
Name Type Description listener -
addListener(type, listener)
-
添加某个类型的监听器
Name Type Description typestring listenerfunction -
disableEvent(type)
-
禁止某个事件触发
Name Type Description type -
removeListener(type, listener)
-
移除某个类型的监听器
Name Type Description typelistener -
resumeEvent(type)
-
恢复某个事件的触发
Name Type Description type -
stop(type)
-
阻止某个事件类型继续传递
Name Type Description type -
triggerListener(type, data)
-
触发某一类型的监听器
Name Type Description typedata