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 simulator we can see the memory usage information in addition to the frame rate information in 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:


#if debug#define display_memory#endif        ... Constructor public        MainPage ()        {            InitializeComponent (); #if display_memory            Starttimer (); ① #else            memorydisplay.visibility = visibility.collapsed; #endif        } ... ...


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 discussionwebsite: http://www.c ocoagame.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.