Cocos2dx+lua created game port to Windows Phone

Source: Internet
Author: User

The problems encountered during the entire port are summarized as follows

1, must use the latest version of the COCOS2DX, the reason for everyone to see Changelog know, the recent COCOS2DX version is fixed on the Windows Phone bug, so in order to avoid the problem, or directly upgrade to the latest version of it

2. If you are using the COCOS2DX + LUA approach, the current project-creator does not support the LUA version of the Windows Phone platform, but the CPP version is supported, So we can add Libcocoslua and Liblua two projects to the project on the basis of the CPP version.

3. Be sure to use the Proj.wp8-xaml version, instead of using the PROJ.WP8 version as your Windows Phone project, Cause the PROJ.WP8 version currently has a problem with cceditbox support and does not add the Libcurl.dll and associated DLLs to the XAP package, if you use curl you will have problems.

4, if using LUA, please change the LuaCocos2d.cpp file to Cocos2d_support/luacocos2d.cpp in the Libextensions project, the default is cocos2d_support/platform/ Winrt/luacocos2d.cpp, that version didn't expose Cceditbox and some other classes to Lua.

5, cocosdenshion in Windows Phone can only play WAV type of file, if you are MP3, will directly crash

6. If you want to change the horizontal screen to a vertical screen, Then only modify the main project MainPage.xaml in the supportedorientation and orientation will not take effect, because this modification is only mainpage to modify, and COCOS2DX is to use D3D to render, you have to tell D3D is now replaced by the vertical screen, the practice is to directly call Cocos2drenderer Onorientationchanged method, but before calling this method must ensure that Cceglview has been initialized, mine is in the Cocos2drenderer:: Createglresources is initialized there to complete. Also note that you must set the desiginresolution otherwise you may see a small piece, this people have met to know how to do.

7. If you want to see the logs printed in Lua, you need to add the debug mode to the Libcocoslua project Cocosdebug=1


The problems encountered and solved are mainly those above, and some problems that have not been solved include

1, inexplicable collapse

2, there are some tableview display dislocation

Both of these issues have entered the business layer and are not yet confirmed to be cocos2dx or our problem, but other platforms including Win32 did not find this problem.

Related Article

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.