Get the App
SLTechnology News&Howtos  ›  Development  › 

How to build cocos2d-x environment

Shulou Source: shulou.com Published: 2022-06-02 16:27:02 11月15日 Update

This article will explain in detail how to build a cocos2d-x environment for you. The content of the article is of high quality, so the editor will share it for you as a reference. I hope you will have some understanding of the relevant knowledge after reading this article.

As I have been busy recently, I haven't written a blog for several days (it seems to be another episode of procrastination). Hurry up today.

Step 1: build the environment

1. Extract the compressed package of cocos2d-x to the mac computer (the path of the author's decompression is

/ Users/shiyiqiong/Documents/Cocos2d-x/cocos2d-2.1rc0-x-2.1.2)

two。 Press the shortcut key ctrl + spacebar, enter terminal, and open the terminal

3. Enter the root directory of 2dx in the terminal (take the author as an example: enter

Cd Documents/Cocos2d-x/cocos2d-2.1rc0-x-2.1.2)

4. Then enter. / install-templates-xcode.sh-u-f

5. In this way, the open environment for iOS is set up.

Step 2: create a project

1. Open Xcode and click Create a new Xcode project to create a new project

two。 Select cocos2dx and click next

3. Enter project name and package name, click next

4. Then select the project save path, and then click Create to complete the project creation.

5. Finally, press command + R key to run Hello World successfully

Step 3: migrate the previous project

1. Overwrite the files in the Class folder and the Resoure folder in the win32 project created in the previous two sections to the corresponding folders in the ios project

two。 Then press command + R to run the project, and successfully migrate the win32 project to ios.

Solved the environmental problem.

On how to build the cocos2d-x environment to share here, I hope that the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

Tags: Project environment file input folder success content article more knowledge author article terminal path migration run selection yes blog again Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple vpn macOS Microsoft OPPO Reno