Cocos2d-x  v4
Event Class Reference

Base class of all kinds of events. More...

Inherits Ref.

Inherited by EventAcceleration, EventCustom, EventFocus, EventKeyboard, EventMouse, and EventTouch.

Public Types

enum  Type
 Type Event type.
 

Public Member Functions

virtual ~Event ()
 Destructor.
 
Type getType () const
 Gets the event type. More...
 
void stopPropagation ()
 Stops propagation for current event.
 
bool isStopped () const
 Checks whether the event has been stopped. More...
 
NodegetCurrentTarget ()
 Gets current target of the event. More...
 
- Public Member Functions inherited from Ref
void retain ()
 Retains the ownership. More...
 
void release ()
 Releases the ownership immediately. More...
 
Refautorelease ()
 Releases the ownership sometime soon automatically. More...
 
unsigned int getReferenceCount () const
 Returns the Ref's current reference count. More...
 
virtual ~Ref ()
 Destructor. More...
 

Protected Member Functions

 Event (Type type)
 Constructor.
 

Additional Inherited Members

- Public Attributes inherited from Ref
unsigned int _ID
 object id, ScriptSupport need public _ID
 
int _luaID
 Lua reference id.
 
void * _scriptObject
 scriptObject, support for swift
 
bool _rooted
 When true, it means that the object was already rooted.
 

Detailed Description

Base class of all kinds of events.

Member Function Documentation

◆ getType()

Type getType ( ) const
inline

Gets the event type.

Returns
The event type.

◆ isStopped()

bool isStopped ( ) const
inline

Checks whether the event has been stopped.

Returns
True if the event has been stopped.

◆ getCurrentTarget()

Node* getCurrentTarget ( )
inline

Gets current target of the event.

Returns
The target with which the event associates.
Note
It's only available when the event listener is associated with node. It returns 0 when the listener is associated with fixed priority.

The documentation for this class was generated from the following file: