Cocos2d-x V2.2 transplantation WP8.

Recommended for you: Get network issues from WhatsUp Gold. Not end users.
Yesterday wrote an article about Windows Phone cocos2dx 8 development, the development of which referred to wp8 a little, so I decided to start an article, detailed introduce the transplantation of wp8 development.

The word does not say more, first create a new project, how to create is not much, if you do not know will jump on a look at it, we need to create the following directory

Enter the Proj.wp8 directory, click on the.Sln file to open
Note, this must be opened with Windows Phone SDK vs, otherwise there is no simulator, but also can not run.

After opening check the solution inside the directory, you can see, in addition to the angleproject, only our project and a libcocos2d, cocos2d apparently only give us into the basic library, sound library CocosDenshion, Box2D and some other physical library library and not into, so we will need these library import, or no by using the method of.

Concrete steps:
The selected solution right-click and choose "existing project"

Select the cocos2d-x-2.2\CocosDenshion\proj.wp8 directory of the.Vcxproj file, because we need wp8 sound library, so don't mistake the selection time, when added after you'll find out the solution which has been the voice of the Kuna for directory

We then take the box2d, and the extensions libraries are added to the future development, if used, steps, box2d database in the external folder, then add all you can see a directory structure now

Look is not that interesting? Hey, like developed under the Win32 directory.

Then we check the project dependencies, right click your project, this is not the solution, select "project dependencies"

Check the database we just added, remember esUtil_phone also check

Then select the project drop-down list, select the "libExtensions", select "libcocos2d", as shown in Fig.

After we right click again to our project, select properties, can be selected, click on the menu bar, select "project" at the bottom of the "properties", click on the "inside the frame and the reference" "add new reference", we add the library to check, such as graph

Our library this time finished, select the solution this time, let it generates.~

Think is not completed, no, you can try to enter the #include " in helloworld.cpp; SimpleAudioEngine", is found to be wrong, cannot open this file? If you can, then even if complete, if not then continue to come, there are some small tips, ha ha~

Right click your project, not the solution, select "properties", to "additional include directories", and then open the edit, as shown in Fig.

Add the following content, so the include can know the new head file we need, have a try is not just the smart tips out

So even if we all finished, you can try the header files can be added, but also not error can not find~

1 under the wp8 sound file to use.Wav MP3 type, type errors, this I am looking for a long time, see the example for a long time to find the problem, the need to pay attention to
2.box2d header files to add #include "Box2D\Box2D.h"
3 some additional controls, such as ScrollView, now went to the GUI here, I don't know what version of the revised, found, adding that when adding #include "GUI\CCScrollView\CCScrollView.h"

I have written before the game successfully run on the simulator, the effect is OK, just don't ever real, do not know what the situation, which I didn't test machine, hope someone can try is also a perfect run~
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download

Posted by Claude at December 12, 2013 - 8:41 PM