cocos3.10 using the Cocostudio callback feature C + + release Notes

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.