CocosCreator system built-in event

Mouse event types and event objects

Mouse events will trigger the desktop platform, the system provides the following types of events
Here Insert Picture Description
mark the event (cc.Event.EventMouse) as an important API (API standard events outside cc.Event)
Here Insert Picture Description

Touch event type objects and events

Here Insert Picture Description
Here Insert Picture Description

  • The so-called enumeration objects that emit in the first argument of, API name that you can call in the callback function API methods
  • Multi-touch support for touch events, each contact will send an event to the event listener.

Pass the touch event

Bubbling transfer

  • And Android developers with one exception, Cocos in bubble bubbling to the parent node, even if the contact is not within the parent node, the parent node will bubble mechanism by touching event receives this event.
  • Bubbling process touch events and event bubbling ordinary course makes no difference. So, call event.stopPropagation () can take the initiative to stop the bubbling process.

Contact ownership issues between siblings

  • Sibling nodes, the nodes at the top of the contacts accepted.Note will not be passed to siblings live coverage

Other events of cc.Node

Here Insert Picture Description

Guess you like

Origin blog.csdn.net/qq_43575267/article/details/88833241