cocos new

cocos new

Overview

Create a new -x or -js project.

Usage

cocos new -l {cpp,lua,js} [arguments] [PROJECT_NAME]

Available Arguments

argavailable valuesampledescriptionnecessary
-h, --help--Show the help message and exitno
-p, --packagestring match *.*.*com.company.pkgnameSet a package name for project. Default is same with templateno
-l, --language{cpp, lua, js}luaMajor programming language you want to use.yes
-d, --directorya absolute(relative) path./projects/Set generate project directory for project. Default is current directoryno
-t, --templatea string of template namedefaultSet the template name you want create from. Default value is defaultno
-e, --engine-patha absolute(relative) path/Users/CurrentUser/cocos2d-xSet the path of cocos2d-x/cocos2d-js engine.no
--mac-bundleida string of mac bundle idcom.company.macbundleidSet a bundle id for mac project. Default is same with templateno
--ios-bundleida string of ios bundle idcom.company.iosbundleidSet a bundle id for ios project. Default is same with templateno

Attentions

  • The cocos2d-console in cocos2d-x can only create project with language is cpp or lua
  • The cocos2d-console in cocos2d-js can only create project with language is js
  • The logic of looking for template is:
    1. Generate the template folder name with [language]-template-[template name].
      For example: The template folder name of cocos new -l lua -t runtime is lua-template-runtime
    2. Find the template folder in the templates directory of engine.

Samples

  • cocos new -h. Show the help message like this:new help
  • cocos new -l lua -p org.cocos2dx.mygame -d ./projects MyLuaGame
    The properties of the created project is:
    • package name is org.cocos2dx.mygame
    • target directory is ./projects
    • project name is MyLuaGame
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值