Cocos2d-x  4.0.0
Public Member Functions | Public Attributes | List of all members
CommonScriptData Struct Reference

For Lua, the CommonScriptData is used to find the Lua function pointer by the handler, then call the Lua function by push the eventName, eventSource(if it not nullptr), eventSourceClassName(if it is nullptr or "", and the eventSource is not nullptr,would give the default string "cc.Ref") into the Lua stack as the parameter when the common event such as is triggered. More...

Public Member Functions

 CommonScriptData (int inHandler, const char *inName, Ref *inSource=nullptr, const char *inClassName=nullptr)
 Constructor of CommonScriptData.
 

Public Attributes

int handler
 The index to find the corresponding to the Lua function pointer.
 
char eventName [64]
 The string value to be pushed into the Lua stack.
 
RefeventSource
 The source object trigger the event,could be nullptr.
 
char eventSourceClassName [64]
 The class name of source object trigger the event, could be nullptr.
 

Detailed Description

For Lua, the CommonScriptData is used to find the Lua function pointer by the handler, then call the Lua function by push the eventName, eventSource(if it not nullptr), eventSourceClassName(if it is nullptr or "", and the eventSource is not nullptr,would give the default string "cc.Ref") into the Lua stack as the parameter when the common event such as is triggered.

NA

Constructor & Destructor Documentation

CommonScriptData ( int  inHandler,
const char *  inName,
Ref inSource = nullptr,
const char *  inClassName = nullptr 
)
inline

Constructor of CommonScriptData.

NA NA

Member Data Documentation

int handler

The index to find the corresponding to the Lua function pointer.

NA NA

char eventName[64]

The string value to be pushed into the Lua stack.

NA NA

Ref* eventSource

The source object trigger the event,could be nullptr.

NA NA

char eventSourceClassName[64]

The class name of source object trigger the event, could be nullptr.

NA NA


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