您的位置:首页 > 编程语言 > Lua

Quick-x Lua 创建一个工程

2014-04-13 11:35 281 查看
Quick-cocos2d-x创建一个工程:

环境Mac OS

在quick-cocos2d-x->bin->下,有个create_project.sh文件,创建工程我们就是使用该脚本文件

使用create_project.sh -h你可以看到它的参数说明 一般情况我们使用到的参数是-p(包名) 和-r(屏幕方向)

如果你想创建个空工程 使用-op即可。

usage: create_project -p package_name

options:
    -h show help
    -p package name
    -o project path (default is "current_dir/last_package_name")
    -r screen orientation (default is "portrait")
    -np dont create project files for platform
    -op only create project files
    -f overwrite exists files
    -c load options from config file
    -q quiet
    -t template dir

screen orientation:
    -r portrait (default)
    -r landscape

config file format:

    return array(
        'package'       => package name,
        'output'        => project path,
        'orientation'   => screen orientation,
        'noproj'        => dont create project files for platform,
        'onlyproj'      => only create project files,
        'force'         => overwrite exists files,
        'quiet'         => quiet,
    );

examples:

    # create new project folder "hello", package name is com.quick2dx.samples.hello
    create_project -p com.quick2dx.samples.hello

    # create project files in exists folder "hello"
    create_project -op -p com.quick2dx.samples.hello

    # load options from config file
    create_project -c my_proj_create_config.php


开始我们的创建工程之旅:

1.打开终端Terminal,进入你要存放项目的目录

cd  /路径/projects


2.使用quick-cocos2d-x->bin下的create_project.sh创建工程

/路径/quick-cocos2d-x/bin/create_projet.sh -p com.quickx.game.test


3.然后在终端上你可以看到:

MD103tekiMacBook-Pro:Quick-X md103$ /Users/md103/Documents/Quick-X/quick-cocos2d-x/bin/create_project.sh -p com.quickx.game.test

config:
    package = "com.quickx.game.test"
    output = "/Users/md103/Documents/Quick-X/test/"
    orientation = "portrait"
    template = "/Users/md103/Documents/Quick-X/quick-cocos2d-x/template/PROJECT_TEMPLATE_01/"

create file "proj.android/AndroidManifest.xml" ... OK
create file "proj.android/build_native.bat" ... OK
create file "proj.android/build_native.sh" ... OK
create file "proj.android/clean.bat" ... OK
create file "proj.android/clean.sh" ... OK
create file "proj.android/jni/Android.mk" ... OK
create file "proj.android/jni/Application.mk" ... OK
create file "proj.android/jni/hellocpp/main.cpp" ... OK
create file "proj.android/jni/list.sh" ... OK
create file "proj.android/project.properties" ... OK
create file "proj.android/res/drawable-hdpi/icon.png" ... OK
create file "proj.android/res/drawable-ldpi/icon.png" ... OK
create file "proj.android/res/drawable-mdpi/icon.png" ... OK
create file "proj.android/res/values/strings.xml" ... OK
create file "proj.android/src/com/quickx/game/test/Test.java" ... OK
create file "proj.ios/test/ios/AppController.h" ... OK
create file "proj.ios/test/ios/AppController.mm" ... OK
create file "proj.ios/test/ios/main.m" ... OK
create file "proj.ios/test/ios/RootViewController.h" ... OK
create file "proj.ios/test/ios/RootViewController.mm" ... OK
create file "proj.ios/test/Prefix.pch" ... OK
create file "proj.ios/test/Resources/Default-568h@2x.png" ... OK
create file "proj.ios/test/Resources/Default.png" ... OK
create file "proj.ios/test/Resources/Default@2x.png" ... OK
create file "proj.ios/test/Resources/Icon-72.png" ... OK
create file "proj.ios/test/Resources/Icon.png" ... OK
create file "proj.ios/test/Resources/Icon@2x.png" ... OK
create file "proj.ios/test/Resources/Info.plist" ... OK
create file "proj.ios/test.xcodeproj/project.pbxproj" ... OK
create file "proj.mac/test.xcodeproj/project.pbxproj" ... OK
create file "proj.mac/AppController.h" ... OK
create file "proj.mac/AppController.mm" ... OK
create file "proj.mac/ConsoleWindow.xib" ... OK
create file "proj.mac/ConsoleWindowController.h" ... OK
create file "proj.mac/ConsoleWindowController.m" ... OK
create file "proj.mac/Icon.icns" ... OK
create file "proj.mac/Info.plist" ... OK
create file "proj.mac/main.m" ... OK
create file "proj.mac/MainMenu.xib" ... OK
create file "proj.mac/NSApplication+SheetAdditions.h" ... OK
create file "proj.mac/NSApplication+SheetAdditions.m" ... OK
create file "proj.mac/PlayerPreferencesDialog.xib" ... OK
create file "proj.mac/PlayerPreferencesDialogController.h" ... OK
create file "proj.mac/PlayerPreferencesDialogController.m" ... OK
create file "proj.mac/Prefix.pch" ... OK
create file "proj.mac/ProjectConfigDialog.xib" ... OK
create file "proj.mac/ProjectConfigDialogController.h" ... OK
create file "proj.mac/ProjectConfigDialogController.mm" ... OK
create file "proj.win32/test.cpp" ... OK
create file "proj.win32/test.h" ... OK
create file "proj.win32/test.sln" ... OK
create file "proj.win32/test.vcxproj" ... OK
create file "proj.win32/test.vcxproj.filters" ... OK
create file "proj.win32/app.ico" ... OK
create file "proj.win32/app.rc" ... OK
create file "proj.win32/ProjectConfigDialog.cpp" ... OK
create file "proj.win32/ProjectConfigDialog.h" ... OK
create file "proj.win32/resource.h" ... OK
create file "proj.win32/stdafx.cpp" ... OK
create file "proj.win32/stdafx.h" ... OK
create file "proj.win32/targetver.h" ... OK
create file "res/framework_precompiled.zip" ... OK
create file "scripts/app/MyApp.lua" ... OK
create file "scripts/app/scenes/MainScene.lua" ... OK
create file "scripts/config.lua" ... OK
create file "scripts/main.lua" ... OK
create file "sources/AppDelegate.cpp" ... OK
create file "sources/AppDelegate.h" ... OK
create file "sources/SimulatorConfig.cpp" ... OK
create file "sources/SimulatorConfig.h" ... OK


4.使用xcode打开运行可以看到Hello World

或者使用quick-x模拟器运行

后面将使用代码来写,一些范例到时候放到github上。看别人写的博客很容易,但是写博客的人真心比较耗时。

感谢那些分享技术心得、写博客的博主。真诚的感谢你们带给我的成长。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: