Cocos2d-x  v4
EventCustom Class Reference

Custom event. More...

Inherits Event.

Inherited by PhysicsContact.

Public Member Functions

 EventCustom (const std::string &eventName)
 Constructor. More...
 
void setUserData (void *data)
 Sets user data. More...
 
void * getUserData () const
 Gets user data. More...
 
const std::string & getEventName () const
 Gets event name. More...
 
- Public Member Functions inherited from Event
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...
 

Additional Inherited Members

- Public Types inherited from Event
enum  Type
 Type Event type.
 
- 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.
 
- Protected Member Functions inherited from Event
 Event (Type type)
 Constructor.
 

Detailed Description

Custom event.

Constructor & Destructor Documentation

◆ EventCustom()

EventCustom ( const std::string &  eventName)

Constructor.

Parameters
eventNameA given name of the custom event. @js ctor

Member Function Documentation

◆ setUserData()

void setUserData ( void *  data)
inline

Sets user data.

Parameters
dataThe user data pointer, it's a void*.

◆ getUserData()

void* getUserData ( ) const
inline

Gets user data.

Returns
The user data pointer, it's a void*.

◆ getEventName()

const std::string& getEventName ( ) const
inline

Gets event name.

Returns
The name of the event.

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