Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cocos2d-x with Visual Studio 2015 cross platform tools

How do I set up Cocos2d-x (3.7) to work with Visual Studio 2015's new C++ cross platform tools for Android and iOS? This is relatively new, and there is not much documentation besides the simplest project. I have Cocos2d-x and a few SDKBOX plugins and I can't seem to get anything set up in Visual Studio.

Go vote here for a sample. https://code.msdn.microsoft.com/site/requests/Cocos2d-x-e34be78c?ShowSubmitLinkForm=False

like image 689
John Cooper Avatar asked Nov 27 '22 15:11

John Cooper


1 Answers

This link seems to hold an explanation and some examples (i.e. links to other git repos). I've followed the instructions below and was able to run a x86 executable on my development system (64 bit did not work). I did not check the Android or iOS projects.

I quoted the getting started part of the link, the rest of the page explains some details about the generated code.

Getting Started

Ensure you have Windows 10 installed. If you cannot install this on your primary machine, you can set up a virtual machine on Windows 10 for Cocos2d-x development.

Download and install Microsoft Visual Studio. Make sure that the “Universal Windows App Development Tools” are selected from the optional features list as these are needed for UWP development.Cocos image 1

Install Python 2.7.x

Add c:\Python27 to the Path Environment setting

I think that I got a correct python installation with visual studio 2015 community edition, that is added to the path automatically.

Clone the Cocos2d-x repo [https://github.com/cocos2d/cocos2d-x] and follow the steps described within the related readme file (download-deps.py and git submodule update –init)

Instead of cloning the git repo, I actually downloaded cocos2d-x-3.8.1.zip from the website, so far this seems to work. I used the following commands in the folder where I unzipped.

python download-deps.py
python setup.py

As said I did not check the Android and/or iOS projects that were generated.

Open up command prompt and use the command:

cocos new myWin10Game -l cpp -d projects

NB: After this generation step, the output prompted me that I needed to change some things in the Android and iOS projects.

Enter the proj.win10 folder and open the solution. In this example, it will be myWin10Game.sln.

like image 124
Timo Avatar answered Dec 09 '22 15:12

Timo