cocos3.10 using the Cocostudio callback feature C + + release Notes
For a long time did not Tinker Cocos2dx, and picked up to play, watching the version of the upgrade, really good fast, Today with the cocos3.10 version of the test time features, and then the official document to do is very smooth, the only last step of the code do not know where to put, the afternoon after the meal back, and in the official words (official address http://www.cocos.com/doc/article/ index?type=cocos%20studio&url=/doc/cocos-docs-master//manual/studio/v4/chapter3/howtocode/callback/ ZH.MD), only to understand, is put home in the front of the CSB, tried, and indeed so.
Only part of the code is sent here, and the rest of the code and the official can always:
//1. Super init first if (! Layer::init ()) { return false; } csloader* instance = csloader::getinstance (); Note The first parameter must be the first step to fill in the custom class name plus "Reader" as described above in "Myclassreader" instance->registreaderobject ("Myclassreader", ( objectfactory::instance) myclassreader::getinstance); Auto RootNode = Csloader::createnode ("MAINSCENE.CSB");//The above is good addChild (rootnode,0,100); return true;}
Look at the question:
5, register this interface to Csloader before loading the node //This is what the node means when you do the scene as node loading.
CSLoader* instance = CSLoader::getInstance();//注意第一个参数必须是第一步填写的自定义类名加“Reader ”如上述的"MyClassReader" instance->registReaderObject("MyClassReader",(ObjectFactory::Instance)MyClassReader::getInstance);
Cocos3.10 using the Cocostudio callback feature C + + release notes