how to merge both cpp and js support in cocos2d to use via command prompt - cocos2d-x

How can I create the C++ project and create the js project using the same console?
I download cocos2d-x 3.6 for cpp and cocos2d-js 3.6.1 for js support and had extracted the zip and run
setup.py contained in both.
But , When i run the command
C:/>cocos new myJsGame -l cpp
It gives the error:
Fatal: can't find any template for language in C:\cocos2d-js v3.6.1\templates
You can specify the path of cocos2d-x by argument '-e'.
I Know that for using cpp support i must specify the cocos2d-x path for cpp which i had downloaded.
But is there any way by which i could use both cpp and js in console without specifying the path always when creating a new cocos project.

copy cpp-template-default and cocos2dx_files.json from cocos2d-x v3.6/templates to cocos2d-js v3.6.1/templates.
i tried,and it works.

cocos new -l js should create a new JS project with also the JS-bindings for Android and windows, including C++ sources.

Related

Cocos2Dx - Create APK from Visual Studio

I new with cocos2Dx and wanna create game for Android with using C++. I use proj.win32 and don't now how build .apk. Can I do this?
Make entry of your .cpp files in Android.mk that exist in jni folder. Find jni folder inside proj.android project module.
LOCAL_SRC_FILES := hellocpp/main.cpp \
../../Classes/AppDelegate.cpp \
../../Classes/HelloWorldScene.cpp
run this command on console
cocos deploy -s ./projects/MyGame -p andoird -m release
where ./projects/MyGame is your project root folder -m release indicated you want .apk in release mode otherwise use debug
If want some Android related code then first import your project into eclipse then put your Android related code then deploy or even through eclipse you can deploy.

How-to convert csb to ccbi file on Windows?

all!
I have some example files (csb) from Cocos2d Studio.
I want to run them on cocos2d-xna framework, but it requires only compiled files (ccbi).
How can I compile or conver csb under Windows or run sprite from csb file :)
Thanks!

How to install cocos2d-x in windows8 and VS2013

I want to install cocos2d-x on my windows8 but i download this "http://bit.ly/18xmkJ9" from "http://cocos2d-x.org/download" in the tutorial says that i must execute a .bat in there or in some other pages says that i neet to create a project in VS, but when i try to do what they say in the tutorial i dont see anithing that is shown.
I'm very lost and help needed.
Could anybody say me hoy to createand start a project on cocos2d?
I have answer the similar question here.
Before cocos2d-x 2.1.2, you can still use templates in VS. However, you can only use python to create project
Install python 2.7
Open command line in Windows
Go to your cocos2d-x-2.1.5\tools\project-creator folder
Run create_project.py. Usage:
create_project.py -project YourProjectName -package com.example.PakcageName -language cpp
-language option:[cpp | lua | javascript]
Your project will be created in cocos2d-x-2.1.5\projects
Then find the win32.proj , open ***.sln

Cannot run Starling helloworld when using source code in FlashDevelop

I have recently installed FlashDevelop 4.4.3 and Starling 1.3.0.
I followed the getting started tutorial of Starling.
I can run the tutorial when I put starling.swc into lib directory and after making "Add to Library".
But if I remove starling.swc from lib directory and instead copy source codes (com and starling directories inside starling\src) of starling framework into my project folder then I get the following error:
C:\projects\ch01_01\src\starling\display\BlendMode.as(42): col: 32 Error: Access of undefined property Context3DBlendFactor
The same error occurs also when I set the classpath to <starling-installation>\starling\src
You don't need to copy anything. Just use the folder with your starling source.
Your classpath should always point to src directory. It won't work if you point to starling directory.
You most likely target wrong flash player version.
set it to 11.5 or something higher.

Package Adobe Air to Exe

Using Flash Builder 4.6, I exported an Adobe Air file from my mobile project.
I'm trying to get it packaged into an EXE (that would include the Adobe Air Runtime)
The project was compiled with Air 3.1. I looked online and there are some ADT commands that people recommend using but the problem is that the command throws errors in Air 3.1
If i use air 3.0 ADT:
AIR file at [app path]/app.air could not be converted.
The error was ""
If I use air 3.1 or air 3.2 sdk
SDK is missing file [my path to air]\lib\nai\bin\naip.exe
I'm running
java -jar [path to air]\lib\adt.jar" -package -target native app.dmg app.air
I've also tried
java -jar [path to air]\lib\adt.jar" -package -target native app.exe app.air
I've also looked into projects like this one: http://bishoponvsto.wordpress.com/2010/02/23/adobe-air-2beta-2-to-exe-packaging-air-app-in-windows-executable/ , but it is for Air 2.0.
Any ideas? Apparently there is an integrated Flash Builder 4.6 tool, but for some reason the option under export release doesn't exist for mobile projects - strange...
Why do you want to do this? Air files -- when exported for a specific platform -- are executables.
If you are looking for an "installer" that will create directories, run the Air installation, and move auxiliary files to specific locations (docs, icons, etc.), then try Inno Setup.
EDIT:
The code you provided works for me to create a Windows EXE. But it seems a bit unecessary . . . why not just export the EXE file from Flash Builder ("Export Release Build" button in the top toolbar)? If you can't or won't, then here are some suggestions:
I am using Java version 1.6.0_29. Make sure your Java is not only up to date, but that you are actually calling the correct version (java -version).
Check the JAR directory text carefully .
Check that you are actually calling to the right Air version.
Make sure that the quotation marks are on both sides of the JAR path.
You should be able to do a "Export Release Build" (though I am using FB 4.5). Instead of selecting "Export as: Signed packages for each target platform", select "Export as: Signed AIR packages for installation on the desktop". (You may have to create a certificate, but you can create one through this export feature, too.)
(If you happen to be able to use the Flash IDE, the exported Air file has to support both "Desktop" and "Extended Desktop".)
Hopefully, this will allow you to both produce an Air program that can be converted to EXE, and actually convert it using the command line.
I know this question is a little old, but a co-worker just ran into the same error message using the command line tools and FlashDevelop. It turns out that he was accidentally packaging some source files into the .air package, an extra copy of the app descriptor and one of the swc's was getting packaged in the .air file. I removed those and repackaged the .air file, then used this command:
adt.bat -package -target bundle kiosk kiosk.air
This successfully created a captive runtime exe. Of course there's no need to create a .air file first, you can package right to native or captive runtime, but since my co-worker was creating .air files I did it that way too just to be sure it would work.