Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
gdevelop:tutorials:howtoexportwithcocos2dx [2018/01/16 23:32]
4ian [Android export]
gdevelop:tutorials:howtoexportwithcocos2dx [2020/06/01 13:27]
rapperdinesh [Android export]
Line 1: Line 1:
 ====== How to export your game with Cocos2d-x ====== ====== How to export your game with Cocos2d-x ======
  
-**Cocos2d-x** is a game engine that can used by GDevelop to render HTML5 games. By default, the underlying rendering engine used by GDevelop when previewing or exporting HTML5 games is **Pixi.js**.+**Cocos2d-x** is a game engine that can be used by GDevelop to render HTML5 games. By default, the underlying rendering engine used by GDevelop when previewing or exporting HTML5 games is **Pixi.js**.
  
-Cocos2d-x provides an engine that enables games to be both exported to the web (using HTML5 and webGL) and to native platforms, including iOS, Android, Windows, Mac OS X and Linux. In both cases, GDevelop game engine is the same, but the rendering is done with Cocos2d-x, using either WebGL on the web or native OpenGL on the other platforms.+Cocos2d-x provides an engine that enables games to be both exported to the web (using HTML5 and WebGL) and to native platforms, including iOS, Android, Windows, Mac OS Xand Linux. In both cases, ​the GDevelop game engine is the same, but the rendering is done with Cocos2d-x, using either WebGL on the web or native OpenGL on the other platforms.
  
 <note tip>​Export with Cocos2d-x is still //​experimental//​. Also, native export to iOS, Android, Windows, Mac OS X and Linux involves installation of some //​additional tools//​.</​note>​ <note tip>​Export with Cocos2d-x is still //​experimental//​. Also, native export to iOS, Android, Windows, Mac OS X and Linux involves installation of some //​additional tools//​.</​note>​
Line 37: Line 37:
 {{ :​gdevelop:​tutorials:​python-path-windows.png?​nolink |}}</​note>​ {{ :​gdevelop:​tutorials:​python-path-windows.png?​nolink |}}</​note>​
  
-  * Check that Python is working : open a command line/​terminal,​ type ''​python''​ and press Enter. If python is launched, you're ready to continue.+  * Check that Python is working: open a command line/​terminal,​ type ''​python''​ and press Enter. If python is launched, you're ready to continue.
  
 <​note>​To open a command line (also called Command Prompt) on **Windows**,​ type ''​cmd''​ in the start menu.\\ <​note>​To open a command line (also called Command Prompt) on **Windows**,​ type ''​cmd''​ in the start menu.\\
Line 50: Line 50:
 {{ :​gdevelop:​tutorials:​cmd-cd-cocos-windows.png?​nolink |}}</​note>​ {{ :​gdevelop:​tutorials:​cmd-cd-cocos-windows.png?​nolink |}}</​note>​
  
-  * Install Cocos2d-x by typing ''​python setup.py''​ in the command line (or ''​C:​\Python27\Python.exe setup.py''​ on Windows). When asked for path of some tools, just press Enter.+  * Install Cocos2d-x by typing ''​python setup.py''​ in the command line (or ''​C:​\Python27\Python.exe setup.py''​ on Windows). When asked for path of some tools, just press Enter.
   * Check that Cocos2d-x is properly installed: reopen **a new command line** and type ''​cocos''​ in the command line. You should see some text explaining the available cocos commands.   * Check that Cocos2d-x is properly installed: reopen **a new command line** and type ''​cocos''​ in the command line. You should see some text explaining the available cocos commands.
  
Line 62: Line 62:
   * Type ''​cocos new -l js MyGame -p com.yourname.mygame''​ and press Enter. Replace ''​MyGame''​ by the name of your game. ''​com.yourname.mygame''​ is a //package name// used to identify your game on the stores. ​   * Type ''​cocos new -l js MyGame -p com.yourname.mygame''​ and press Enter. Replace ''​MyGame''​ by the name of your game. ''​com.yourname.mygame''​ is a //package name// used to identify your game on the stores. ​
  
-Wait a bit: Cocos will now create a new folder with the name of your game. It will contains ​everything needed to compile the game.+Wait a bit: Cocos will now create a new folder with the name of your game. It will contain ​everything needed to compile the game.
  
   * With the command line, go in the folder created by Cocos2d-x: ''​cd MyGame''​ (replace MyGame by the name of your game).   * With the command line, go in the folder created by Cocos2d-x: ''​cd MyGame''​ (replace MyGame by the name of your game).
Line 68: Line 68:
 {{ :​gdevelop:​tutorials:​cocos-new-game.png?​nolink |}} {{ :​gdevelop:​tutorials:​cocos-new-game.png?​nolink |}}
  
-  * Now, using GDevelop, choose to export your game with Cocos2d-x (see the first section if you need help). Choose the folder created by Cocos2d-x as the export folder in GDevelop. Finally press Export.+  * Now, using GDevelop, choose to export your game with Cocos2d-x (see the first section if you need help). Choose the folder created by Cocos2d-x as the export folder in GDevelop. Finallypress Export.
  
 You're ready! You now have a full game exported with GDevelop and ready to be compiled with ''​cocos'':​ see the sections below to know how to export for a specific platform. You're ready! You now have a full game exported with GDevelop and ready to be compiled with ''​cocos'':​ see the sections below to know how to export for a specific platform.
Line 81: Line 81:
   * Download and install the **Android NDK**.   * Download and install the **Android NDK**.
   * Relaunch ''​python setup.py''​ (or ''​C:​\Python27\Python.exe setup.py''​),​ using the command line, in the folder of Cocos2d-x.   * Relaunch ''​python setup.py''​ (or ''​C:​\Python27\Python.exe setup.py''​),​ using the command line, in the folder of Cocos2d-x.
-  * Create a keystore ​inside the game folder:+  * Create a Keystore ​inside the game folder:
  
-     The following command requires ​keytool which is installed as part of the Java Development Kit (JDK). It will create a keystore ​in the current folder, just remember to change '​Your_personal_file_title'​ and then press enter. ​ You will be asked a few questions and then be prompted to create the keystore, just type yes and press enter.+     The following command requires ​a key tool that is installed as part of the Java Development Kit (JDK). It will create a Keystore ​in the current folder, just remember to change '​Your_personal_file_title'​ and then press enter. ​ You will be asked a few questions and then be prompted to create the Keystore, just type yesand press enter.
  
      ''​keytool -genkey -v -keystore Your_personal_file_title.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000''​      ''​keytool -genkey -v -keystore Your_personal_file_title.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000''​
Line 90: Line 90:
  
   * With the command line, in the folder of your game, launch ''​cocos compile -p android -m release''​.   * With the command line, in the folder of your game, launch ''​cocos compile -p android -m release''​.
-  * The first time you compile this project you will be asked to enter the path to the keystore ​at the end of the compilation.  ​+  * The first time you compile this project you will be asked to enter the path to the Keystore ​at the end of the compilation.  ​
   ​   ​
-  * Enter the full path, including the filename i.e ''​F:​\GDevelop\cocos2d-x-3.10\MyAwesomeGame\mystore.keystore''​ and press enter. ​ You will then be asked for the alias_name and password you entered when creating the keystore.+  * Enter the full path, including the filename i.e ''​F:​\GDevelop\cocos2d-x-3.10\MyAwesomeGame\mystore.keystore''​ and press enter. ​ You will then be asked for the alias_name and password you entered when creating the Keystore.
   * Wait for the compilation to be done: this can be quite long the first time you launch it.   * Wait for the compilation to be done: this can be quite long the first time you launch it.