Cocos2d-x  v4
ScriptEngineManager Class Reference

ScriptEngineManager is a singleton which manager an object instance of ScriptEngineProtocol, such as LuaEngine. More...

Public Member Functions

 ~ScriptEngineManager ()
 Constructor of ScriptEngineManager. More...
 
ScriptEngineProtocol * getScriptEngine ()
 Get the ScriptEngineProtocol object. More...
 
void setScriptEngine (ScriptEngineProtocol *scriptEngine)
 Set the ScriptEngineProtocol object should be managed. More...
 
void removeScriptEngine ()
 Remove the ScriptEngineProtocol object managed. More...
 

Static Public Member Functions

static ScriptEngineManager * getInstance ()
 Get the instance of ScriptEngineManager object. More...
 
static void destroyInstance ()
 Destroy the singleton about ScriptEngineManager. More...
 
static bool sendActionEventToJS (Action *actionObject, int eventType, void *param)
 @lua NA @js NA
 
static bool sendNodeEventToJS (Node *node, int action)
 @lua NA @js NA
 
static bool sendNodeEventToJSExtended (Node *node, int action)
 @lua NA @js NA
 
static void sendNodeEventToLua (Node *node, int action)
 Call the Lua function when the event of node is triggered. More...
 

Detailed Description

ScriptEngineManager is a singleton which manager an object instance of ScriptEngineProtocol, such as LuaEngine.

Since
v0.99.5-x-0.8.5 @js NA

Constructor & Destructor Documentation

◆ ~ScriptEngineManager()

Constructor of ScriptEngineManager.

@lua NA @js NA

Member Function Documentation

◆ getScriptEngine()

ScriptEngineProtocol* getScriptEngine ( )
inline

Get the ScriptEngineProtocol object.

Returns
the ScriptEngineProtocol object.

@lua NA @js NA

◆ setScriptEngine()

void setScriptEngine ( ScriptEngineProtocol *  scriptEngine)

Set the ScriptEngineProtocol object should be managed.

Parameters
scriptEngineshould be managed.

@lua NA @js NA

◆ removeScriptEngine()

void removeScriptEngine ( )

Remove the ScriptEngineProtocol object managed.

@lua NA @js NA

◆ getInstance()

static ScriptEngineManager* getInstance ( )
static

Get the instance of ScriptEngineManager object.

Returns
the instance of ScriptEngineManager object.

@lua NA @js NA

◆ destroyInstance()

static void destroyInstance ( )
static

Destroy the singleton about ScriptEngineManager.

@lua NA @js NA

◆ sendNodeEventToLua()

static void sendNodeEventToLua ( Node *  node,
int  action 
)
static

Call the Lua function when the event of node is triggered.

Parameters
nodethe nativeobject triggers the event.
actionthe specific type.

@lua NA @js NA


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