Windows 8.1 Universal App Support in Cocos2d-x v2.2.5

Datetime:2016-08-23 04:31:59          Topic: Cocos2d-X           Share

In ourrecent blog post, we spoke about Universal Apps support coming to Cocos2d-x V3. The response of the community was positive and encouraging, but it often came with the same follow up question :-) : “what about support for V2” ?

We recognize that while the maintainers of the Cocos2d-x framework stay busy adding new capabilities to the cutting-edge version of the technology, many game developers have accumulated assets and expertise in older versions (especially V2.X), and they reasonably wish to leverage those investments as much as possible.

So based on your feedback, during our Microsoft Virtual Academy live video session on "Build a Game with Cocos2d-x for Windows Devices Jump Start" ( Microsoft Virtual Academy ) we just announced Windows 8.1 Universal App support for cocos2d-x version 2.2.5. The new Universal App project for Cocos2d-x uses the latest version of ANGLE. It provides about 30% faster frame rates and uses half the memory for textures than the previous version.

With this new version of Cocos2d-x, developers can create projects for 4 different Windows device platforms at the same time!

The Universal App has one solution file (.sln) containing 2 projects:

· Windows 8.1

· Windows Phone 8.1

The other folders will contains the Windows 8.0 projects:

· Windows 8.0

· Windows Phone 8.0

With a Universal App developers can share up to 99% of their code between the different targets.

The following pictures show the same code running on Windows and Windows Phone:

clip_image002[6]

clip_image004[5]

To clone this version:

(This version is not yet merged with the master Cocos2d-x repo, so you need to use the MSOpenTech repo)

git clone https://github.com/MSOpenTech/cocos2d-x.git

cd cocos2d-x

git checkout v2-universal

git submodule update --init

download-deps.py

Create and Test your Universal App Project:

cd tools\project-creator

create_project.py -project RocketMan -package com.foo.rocketman -language cpp

This will create a folder called RocketMan in your cocos2d-x\projects folder. The folder will contain the following cocos2d-x project directories:

clip_image005[6]

The Universal App project is in the proj.win8.1-universal folder. The Windows Phone 8.0 project is in the proj-wp8-xaml folder and the Windows Store 8.0 project is in the proj.winrt folder.

Open RocketMan.sln in cocos2d-x\projects\RocketMan\proj-win8.1-universal\

clip_image006[6]

Add your game project files to the Classes folder in the RocketMan.Shared project

clip_image007[5]

Have fun with the new Universal App version of Cocos2d-x! As always, your feedback is important to us. Please open issues on the repo, or just leave comments on this blog…

Adalberto Foresti - Principal Program Manager Lead

Dale Stammen – Software Engineer

Eric Mittelette – Senior Technical Evangelist

Microsoft Open Technologies, Inc.





About List