Axmol Engine 2.4.0-258ceca
Loading...
Searching...
No Matches
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.Object") into the Lua stack as the parameter when the common event such as is triggered. More...

#include <ScriptSupport.h>

Public Member Functions

 CommonScriptData (int inHandler, const char *inName, Object *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.
 
ObjecteventSource
 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.Object") into the Lua stack as the parameter when the common event such as is triggered.

@js NA

Constructor & Destructor Documentation

◆ CommonScriptData()

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

Constructor of CommonScriptData.

@lua NA @js NA

Member Data Documentation

◆ handler

int handler

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

@lua NA @js NA

◆ eventName

char eventName[64]

The string value to be pushed into the Lua stack.

@lua NA @js NA

◆ eventSource

Object* eventSource

The source object trigger the event,could be nullptr.

@lua NA @js NA

◆ eventSourceClassName

char eventSourceClassName[64]

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

@lua NA @js NA


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