cocos2d-x  3.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
CSLoader Class Reference

#include <CSLoader.h>

Public Member Functions

 CSLoader ()
void purge ()
void init ()
var init ()
local init ()
cocos2d::NodecreateNodeFromJson (const std::string &filename)
local createNodeFromJson ( local filename)
cocos2d::NodeloadNodeWithFile (const std::string &fileName)
cocos2d::NodeloadNodeWithContent (const std::string &content)
void setRecordJsonPath (bool record)
bool isRecordJsonPath () const
void setJsonPath (std::string jsonPath)
std::string getJsonPath () const
cocos2d::NodecreateNodeWithFlatBuffersFile (const std::string &filename)
local createNodeWithFlatBuffersFile ( local filename)
cocos2d::NodenodeWithFlatBuffersFile (const std::string &fileName)
local nodeWithFlatBuffersFile ( local fileName)
cocos2d::NodenodeWithFlatBuffers (const flatbuffers::NodeTree *nodetree)
bool bindCallback (const std::string &callbackName, const std::string &callbackType, cocos2d::ui::Widget *sender, cocos2d::Node *handler)
void registReaderObject (const std::string &className, ObjectFactory::Instance ins)
cocos2d::NodecreateNodeWithFlatBuffersForSimulator (const std::string &filename)
cocos2d::NodenodeWithFlatBuffersForSimulator (const flatbuffers::NodeTree *nodetree)

Static Public Member Functions

static CSLoadergetInstance ()
static void destroyInstance ()
local destroyInstance ()
static cocos2d::NodecreateNode (const std::string &filename)
local createNode ( local filename)
static
cocostudio::timeline::ActionTimeline * 
createTimeline (const std::string &filename)
local createTimeline ( local filename)

Protected Types

typedef std::function
< cocos2d::Node *(const
rapidjson::Value &json)> 
NodeCreateFunc
typedef std::pair< std::string,
NodeCreateFunc
Pair
typedef std::function
< cocos2d::Component *(const
rapidjson::Value &json)> 
ComponentCreateFunc
typedef std::pair< std::string,
ComponentCreateFunc
ComponentPair

Protected Member Functions

cocos2d::NodeloadNode (const rapidjson::Value &json)
void locateNodeWithMulresPosition (cocos2d::Node *node, const rapidjson::Value &json)
local locateNodeWithMulresPosition ( local node, local json)
void initNode (cocos2d::Node *node, const rapidjson::Value &json)
cocos2d::NodeloadSimpleNode (const rapidjson::Value &json)
cocos2d::NodeloadSubGraph (const rapidjson::Value &json)
var loadSubGraph ( var json)
local loadSubGraph ( local json)
cocos2d::NodeloadSprite (const rapidjson::Value &json)
var loadSprite ( var json)
local loadSprite ( local json)
cocos2d::NodeloadParticle (const rapidjson::Value &json)
var loadParticle ( var json)
local loadParticle ( local json)
cocos2d::NodeloadTMXTiledMap (const rapidjson::Value &json)
var loadTMXTiledMap ( var json)
local loadTMXTiledMap ( local json)
cocos2d::NodeloadWidget (const rapidjson::Value &json)
var loadWidget ( var json)
local loadWidget ( local json)
cocos2d::ComponentloadComponent (const rapidjson::Value &json)
cocos2d::ComponentloadComAudio (const rapidjson::Value &json)
var loadComAudio ( var json)
local loadComAudio ( local json)
bool isWidget (const std::string &type)
bool isCustomWidget (const std::string &type)
std::string getGUIClassName (const std::string &name)
var getGUIClassName ( var name)
local getGUIClassName ( local name)
std::string getWidgetReaderClassName (cocos2d::ui::Widget *widget)
local getWidgetReaderClassName ( local widget)

Protected Attributes

std::unordered_map
< std::string, NodeCreateFunc
_funcs
var _funcs
std::unordered_map
< std::string,
ComponentCreateFunc
_componentFuncs
bool _recordJsonPath
std::string _jsonPath
std::string _monoCocos2dxVersion
var _monoCocos2dxVersion
local _monoCocos2dxVersion
Node_rootNode
std::string _csBuildID

Member Typedef Documentation

typedef std::function
<cocos2d::Component*(const
rapidjson::Value& json)>
ComponentCreateFunc
protected
var ComponentCreateFunc
protected
local ComponentCreateFunc
protected
typedef std::pair<std::string,
ComponentCreateFunc>
ComponentPair
protected
var ComponentPair
protected
local ComponentPair
protected
typedef std::function
<cocos2d::Node*(const
rapidjson::Value& json)>
NodeCreateFunc
protected
var NodeCreateFunc
protected
local NodeCreateFunc
protected
typedef std::pair<std::string,
NodeCreateFunc> Pair
protected
var Pair
protected
local Pair
protected

Constructor & Destructor Documentation

CSLoader ( )
var CSLoader ( )
local CSLoader ( )

Member Function Documentation

bool bindCallback ( const std::string &  callbackName,
const std::string &  callbackType,
cocos2d::ui::Widget sender,
cocos2d::Node handler 
)
var bindCallback ( var  callbackName,
var  callbackType,
var  sender,
var  handler 
)
local bindCallback ( local  callbackName,
local  callbackType,
local  sender,
local  handler 
)
static cocos2d::Node* createNode ( const std::string &  filename)
static
var createNode ( var  filename)
static
local createNode ( local  filename)
static
cocos2d::Node* createNodeFromJson ( const std::string &  filename)
var createNodeFromJson ( var  filename)
local createNodeFromJson ( local  filename)
cocos2d::Node*
createNodeWithFlatBuffersFile
( const std::string &  filename)
var createNodeWithFlatBuffersFile ( var  filename)
local createNodeWithFlatBuffersFile ( local  filename)
cocos2d::Node*
createNodeWithFlatBuffersForSimulator
( const std::string &  filename)
var
createNodeWithFlatBuffersForSimulator
( var  filename)
local
createNodeWithFlatBuffersForSimulator
( local  filename)
static
cocostudio::timeline::ActionTimeline*
createTimeline
( const std::string &  filename)
static
var createTimeline ( var  filename)
static
local createTimeline ( local  filename)
static
static void destroyInstance ( )
static
var destroyInstance ( )
static
local destroyInstance ( )
static
std::string getGUIClassName ( const std::string &  name)
protected
var getGUIClassName ( var  name)
protected
local getGUIClassName ( local  name)
protected
static CSLoader* getInstance ( )
static
var getInstance ( )
static
local getInstance ( )
static
std::string getJsonPath ( ) const
inline
var getJsonPath ( )
inline
local getJsonPath ( )
inline
std::string
getWidgetReaderClassName
( cocos2d::ui::Widget widget)
protected
var getWidgetReaderClassName ( var  widget)
protected
local getWidgetReaderClassName ( local  widget)
protected
void init ( )
var init ( )
local init ( )
void initNode ( cocos2d::Node node,
const rapidjson::Value &  json 
)
protected
var initNode ( var  node,
var  json 
)
protected
local initNode ( local  node,
local  json 
)
protected
bool isCustomWidget ( const std::string &  type)
protected
var isCustomWidget ( var  type)
protected
local isCustomWidget ( local  type)
protected
bool isRecordJsonPath ( ) const
inline
var isRecordJsonPath ( )
inline
local isRecordJsonPath ( )
inline
bool isWidget ( const std::string &  type)
protected
var isWidget ( var  type)
protected
local isWidget ( local  type)
protected
cocos2d::Component* loadComAudio ( const rapidjson::Value &  json)
protected
var loadComAudio ( var  json)
protected
local loadComAudio ( local  json)
protected
cocos2d::Component* loadComponent ( const rapidjson::Value &  json)
protected
var loadComponent ( var  json)
protected
local loadComponent ( local  json)
protected
cocos2d::Node* loadNode ( const rapidjson::Value &  json)
protected
var loadNode ( var  json)
protected
local loadNode ( local  json)
protected
cocos2d::Node* loadNodeWithContent ( const std::string &  content)
var loadNodeWithContent ( var  content)
local loadNodeWithContent ( local  content)
cocos2d::Node* loadNodeWithFile ( const std::string &  fileName)
var loadNodeWithFile ( var  fileName)
local loadNodeWithFile ( local  fileName)
cocos2d::Node* loadParticle ( const rapidjson::Value &  json)
protected
var loadParticle ( var  json)
protected
local loadParticle ( local  json)
protected
cocos2d::Node* loadSimpleNode ( const rapidjson::Value &  json)
protected
var loadSimpleNode ( var  json)
protected
local loadSimpleNode ( local  json)
protected
cocos2d::Node* loadSprite ( const rapidjson::Value &  json)
protected
var loadSprite ( var  json)
protected
local loadSprite ( local  json)
protected
cocos2d::Node* loadSubGraph ( const rapidjson::Value &  json)
protected
var loadSubGraph ( var  json)
protected
local loadSubGraph ( local  json)
protected
cocos2d::Node* loadTMXTiledMap ( const rapidjson::Value &  json)
protected
var loadTMXTiledMap ( var  json)
protected
local loadTMXTiledMap ( local  json)
protected
cocos2d::Node* loadWidget ( const rapidjson::Value &  json)
protected
var loadWidget ( var  json)
protected
local loadWidget ( local  json)
protected
void locateNodeWithMulresPosition ( cocos2d::Node node,
const rapidjson::Value &  json 
)
protected
var locateNodeWithMulresPosition ( var  node,
var  json 
)
protected
local locateNodeWithMulresPosition ( local  node,
local  json 
)
protected
cocos2d::Node* nodeWithFlatBuffers ( const flatbuffers::NodeTree nodetree)
var nodeWithFlatBuffers ( var  nodetree)
local nodeWithFlatBuffers ( local  nodetree)
cocos2d::Node*
nodeWithFlatBuffersFile
( const std::string &  fileName)
var nodeWithFlatBuffersFile ( var  fileName)
local nodeWithFlatBuffersFile ( local  fileName)
cocos2d::Node*
nodeWithFlatBuffersForSimulator
( const flatbuffers::NodeTree nodetree)
var nodeWithFlatBuffersForSimulator ( var  nodetree)
local
nodeWithFlatBuffersForSimulator
( local  nodetree)
void purge ( )
var purge ( )
local purge ( )
void registReaderObject ( const std::string &  className,
ObjectFactory::Instance  ins 
)
var registReaderObject ( var  className,
var  ins 
)
local registReaderObject ( local  className,
local  ins 
)
void setJsonPath ( std::string  jsonPath)
inline
var setJsonPath ( var  jsonPath)
inline
local setJsonPath ( local  jsonPath)
inline
void setRecordJsonPath ( bool  record)
inline
var setRecordJsonPath ( var  record)
inline
local setRecordJsonPath ( local  record)
inline

Member Data Documentation

std::unordered_map<std::string,
ComponentCreateFunc>
_componentFuncs
protected
var _componentFuncs
protected
local _componentFuncs
protected
std::string _csBuildID
protected
var _csBuildID
protected
local _csBuildID
protected
std::unordered_map<std::string,
NodeCreateFunc> _funcs
protected
var _funcs
protected
local _funcs
protected
std::string _jsonPath
protected
var _jsonPath
protected
local _jsonPath
protected
std::string _monoCocos2dxVersion
protected
var _monoCocos2dxVersion
protected
local _monoCocos2dxVersion
protected
bool _recordJsonPath
protected
var _recordJsonPath
protected
local _recordJsonPath
protected
Node* _rootNode
protected
var _rootNode
protected
local _rootNode
protected

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