Cocos2d-x 3.x Windows Phone 8 project

Source: Internet
Author: User

Cocos2d-x 3.x We use Cocos2d-x 3.2, which provides support for the Windows Phone 8 platform. Let's look at how to build the Cocos2d-x Windows Phone 8 project in Cocos2d-x 3.2 and how to use it.


Build Windows Phone 8 Project
We can build a multiplatform template project with the Cocos New tool provided by Cocos2d-x. If our project is named Hellocpp, then the directory structure is generated as shown, where the contents of the Proj.wp8-xaml folder, as shown in the following figure, where HelloCpp.sln can start cocos2d-x Windows Phone 8 project.

Build Windows Phone 8 Project


Proj.wp8-xaml folder



Tip If you are using the COCOS2D-X-3.2ALPHA0 version, the solution compilation process will occur during the CCSprite3DDataCache.cpp file cannot find the error, please in the visual Studio Open Libcocos2d project in 3d directory right-click Delete CCSprite3DDataCache.cpp and CCSprite3DDataCache.h.
After successfully starting the project, see as shown in the engineering structure, where Hellocpp starts the project, it is a window Phone 8 project, written using C # code. The classes in Hellocppcomponent is something that needs to be modified, and other files we don't need to modify.


Windows Phone 8 Project



Running Windows Phone 8 project
Set Hellocpp to start the project as shown, select the device or emulator you want to run to, and then click the Start button to run the project. As shown in the following figure, the results are run on the emulator.



Operation Engineering




Running on the emulator

We can also see the memory usage information in addition to the frame rate information we can see on the simulation. The hidden memory usage information output differs from the hidden frame rate information output if the debug deployment mode runs explicitly and is hidden if the release deployment mode runs. This is achieved through the MainPage.xaml.cs defined in the Hellocpp project, the following sections of the code are as follows:


[HTML] view Plaincopy

  1. #if DEBUG

  2. #define Display_memory

  3. #endif

  4. ... ...

  5. Constructor

  6. Public MainPage ()

  7. {

  8. InitializeComponent ();

  9. #if display_memory

  10. Starttimer (); ①

  11. #else

  12. memorydisplay.visibility  =  Visibility .  Collapsed;

  13. #endif

  14. }

  15. ... ...



The above ① Line code Starttimer () can display memory usage information.


For more information, please pay attention to the first Cocos2d-x 3.2 Edition book "Cocos2d-x: C + + volume"

Book Exchange Discussion website: http://www.cocoagame.net
For more exciting video courses, please follow Cocos class: Http://v.51work6.com

Welcome to join Cocos2d-x Technical discussion group: 257760386

Welcome to Luxgen iOS Classroom public Platform


Cocos2d-x 3.x Windows Phone 8 project

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.