2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
--------------------------------
|
|
|
|
-- @module EventDispatcher
|
2014-03-20 10:21:28 +08:00
|
|
|
-- @extend Ref
|
2014-06-25 17:36:50 +08:00
|
|
|
-- @parent_module cc
|
2014-03-18 15:55:30 +08:00
|
|
|
|
2014-03-10 14:04:58 +08:00
|
|
|
--------------------------------
|
2014-09-02 13:45:07 +08:00
|
|
|
-- Pauses all listeners which are associated the specified target.
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#EventDispatcher] pauseEventListenersForTarget
|
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #cc.Node target
|
|
|
|
-- @param #bool recursive
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return EventDispatcher#EventDispatcher self (return value: cc.EventDispatcher)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
--------------------------------
|
2014-09-02 13:45:07 +08:00
|
|
|
-- Adds a event listener for a specified event with the priority of scene graph.<br>
|
|
|
|
-- param listener The listener of a specified event.<br>
|
|
|
|
-- param node The priority of the listener is based on the draw order of this node.<br>
|
|
|
|
-- note The priority of scene graph will be fixed value 0. So the order of listener item<br>
|
|
|
|
-- in the vector will be ' <0, scene graph (0 priority), >0'.
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#EventDispatcher] addEventListenerWithSceneGraphPriority
|
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #cc.EventListener listener
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @param #cc.Node node
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return EventDispatcher#EventDispatcher self (return value: cc.EventDispatcher)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
--------------------------------
|
2014-09-02 13:45:07 +08:00
|
|
|
-- Whether to enable dispatching events
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#EventDispatcher] setEnabled
|
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #bool isEnabled
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return EventDispatcher#EventDispatcher self (return value: cc.EventDispatcher)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
--------------------------------
|
2014-09-02 13:45:07 +08:00
|
|
|
-- Adds a event listener for a specified event with the fixed priority.<br>
|
|
|
|
-- param listener The listener of a specified event.<br>
|
|
|
|
-- param fixedPriority The fixed priority of the listener.<br>
|
|
|
|
-- note A lower priority will be called before the ones that have a higher value.<br>
|
|
|
|
-- 0 priority is forbidden for fixed priority since it's used for scene graph based priority.
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#EventDispatcher] addEventListenerWithFixedPriority
|
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #cc.EventListener listener
|
|
|
|
-- @param #int fixedPriority
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return EventDispatcher#EventDispatcher self (return value: cc.EventDispatcher)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
--------------------------------
|
2014-09-02 13:45:07 +08:00
|
|
|
-- Remove a listener<br>
|
|
|
|
-- param listener The specified event listener which needs to be removed.
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#EventDispatcher] removeEventListener
|
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #cc.EventListener listener
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return EventDispatcher#EventDispatcher self (return value: cc.EventDispatcher)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
--------------------------------
|
2014-09-02 13:45:07 +08:00
|
|
|
-- Resumes all listeners which are associated the specified target.
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#EventDispatcher] resumeEventListenersForTarget
|
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #cc.Node target
|
|
|
|
-- @param #bool recursive
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return EventDispatcher#EventDispatcher self (return value: cc.EventDispatcher)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
--------------------------------
|
2014-09-02 13:45:07 +08:00
|
|
|
-- Removes all listeners which are associated with the specified target.
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#EventDispatcher] removeEventListenersForTarget
|
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #cc.Node target
|
|
|
|
-- @param #bool recursive
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return EventDispatcher#EventDispatcher self (return value: cc.EventDispatcher)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
--------------------------------
|
2014-09-02 13:45:07 +08:00
|
|
|
-- Sets listener's priority with fixed value.
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#EventDispatcher] setPriority
|
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #cc.EventListener listener
|
|
|
|
-- @param #int fixedPriority
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return EventDispatcher#EventDispatcher self (return value: cc.EventDispatcher)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
--------------------------------
|
2014-09-02 13:45:07 +08:00
|
|
|
-- Adds a Custom event listener.<br>
|
|
|
|
-- It will use a fixed priority of 1.<br>
|
|
|
|
-- return the generated event. Needed in order to remove the event from the dispather
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#EventDispatcher] addCustomEventListener
|
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #string eventName
|
|
|
|
-- @param #function callback
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @return EventListenerCustom#EventListenerCustom ret (return value: cc.EventListenerCustom)
|
|
|
|
|
|
|
|
--------------------------------
|
2014-09-02 13:45:07 +08:00
|
|
|
-- Dispatches the event<br>
|
|
|
|
-- Also removes all EventListeners marked for deletion from the<br>
|
|
|
|
-- event dispatcher list.
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#EventDispatcher] dispatchEvent
|
|
|
|
-- @param self
|
|
|
|
-- @param #cc.Event event
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return EventDispatcher#EventDispatcher self (return value: cc.EventDispatcher)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
--------------------------------
|
2014-09-02 13:45:07 +08:00
|
|
|
-- Removes all listeners
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#EventDispatcher] removeAllEventListeners
|
|
|
|
-- @param self
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return EventDispatcher#EventDispatcher self (return value: cc.EventDispatcher)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
--------------------------------
|
2014-09-02 13:45:07 +08:00
|
|
|
-- Removes all custom listeners with the same event name
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#EventDispatcher] removeCustomEventListeners
|
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #string customEventName
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return EventDispatcher#EventDispatcher self (return value: cc.EventDispatcher)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
--------------------------------
|
2014-09-02 13:45:07 +08:00
|
|
|
-- Checks whether dispatching events is enabled
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#EventDispatcher] isEnabled
|
|
|
|
-- @param self
|
|
|
|
-- @return bool#bool ret (return value: bool)
|
|
|
|
|
|
|
|
--------------------------------
|
2014-09-02 13:45:07 +08:00
|
|
|
-- Removes all listeners with the same event listener type
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#EventDispatcher] removeEventListenersForType
|
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #int listenerType
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return EventDispatcher#EventDispatcher self (return value: cc.EventDispatcher)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
--------------------------------
|
2014-09-02 13:45:07 +08:00
|
|
|
-- Constructor of EventDispatcher
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#EventDispatcher] EventDispatcher
|
|
|
|
-- @param self
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return EventDispatcher#EventDispatcher self (return value: cc.EventDispatcher)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
return nil
|