Quick-x Lua 创建一个工程

来源:互联网 发布:长治学院网络教学平台 编辑:程序博客网 时间:2024/06/06 01:21


Quick-cocos2d-x创建一个工程:

环境Mac OS


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


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


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

usage: create_project -p package_nameoptions:    -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 dirscreen orientation:    -r portrait (default)    -r landscapeconfig 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.testconfig:    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" ... OKcreate file "proj.android/build_native.bat" ... OKcreate file "proj.android/build_native.sh" ... OKcreate file "proj.android/clean.bat" ... OKcreate file "proj.android/clean.sh" ... OKcreate file "proj.android/jni/Android.mk" ... OKcreate file "proj.android/jni/Application.mk" ... OKcreate file "proj.android/jni/hellocpp/main.cpp" ... OKcreate file "proj.android/jni/list.sh" ... OKcreate file "proj.android/project.properties" ... OKcreate file "proj.android/res/drawable-hdpi/icon.png" ... OKcreate file "proj.android/res/drawable-ldpi/icon.png" ... OKcreate file "proj.android/res/drawable-mdpi/icon.png" ... OKcreate file "proj.android/res/values/strings.xml" ... OKcreate file "proj.android/src/com/quickx/game/test/Test.java" ... OKcreate file "proj.ios/test/ios/AppController.h" ... OKcreate file "proj.ios/test/ios/AppController.mm" ... OKcreate file "proj.ios/test/ios/main.m" ... OKcreate file "proj.ios/test/ios/RootViewController.h" ... OKcreate file "proj.ios/test/ios/RootViewController.mm" ... OKcreate file "proj.ios/test/Prefix.pch" ... OKcreate file "proj.ios/test/Resources/Default-568h@2x.png" ... OKcreate file "proj.ios/test/Resources/Default.png" ... OKcreate file "proj.ios/test/Resources/Default@2x.png" ... OKcreate file "proj.ios/test/Resources/Icon-72.png" ... OKcreate file "proj.ios/test/Resources/Icon.png" ... OKcreate file "proj.ios/test/Resources/Icon@2x.png" ... OKcreate file "proj.ios/test/Resources/Info.plist" ... OKcreate file "proj.ios/test.xcodeproj/project.pbxproj" ... OKcreate file "proj.mac/test.xcodeproj/project.pbxproj" ... OKcreate file "proj.mac/AppController.h" ... OKcreate file "proj.mac/AppController.mm" ... OKcreate file "proj.mac/ConsoleWindow.xib" ... OKcreate file "proj.mac/ConsoleWindowController.h" ... OKcreate file "proj.mac/ConsoleWindowController.m" ... OKcreate file "proj.mac/Icon.icns" ... OKcreate file "proj.mac/Info.plist" ... OKcreate file "proj.mac/main.m" ... OKcreate file "proj.mac/MainMenu.xib" ... OKcreate file "proj.mac/NSApplication+SheetAdditions.h" ... OKcreate file "proj.mac/NSApplication+SheetAdditions.m" ... OKcreate file "proj.mac/PlayerPreferencesDialog.xib" ... OKcreate file "proj.mac/PlayerPreferencesDialogController.h" ... OKcreate file "proj.mac/PlayerPreferencesDialogController.m" ... OKcreate file "proj.mac/Prefix.pch" ... OKcreate file "proj.mac/ProjectConfigDialog.xib" ... OKcreate file "proj.mac/ProjectConfigDialogController.h" ... OKcreate file "proj.mac/ProjectConfigDialogController.mm" ... OKcreate file "proj.win32/test.cpp" ... OKcreate file "proj.win32/test.h" ... OKcreate file "proj.win32/test.sln" ... OKcreate file "proj.win32/test.vcxproj" ... OKcreate file "proj.win32/test.vcxproj.filters" ... OKcreate file "proj.win32/app.ico" ... OKcreate file "proj.win32/app.rc" ... OKcreate file "proj.win32/ProjectConfigDialog.cpp" ... OKcreate file "proj.win32/ProjectConfigDialog.h" ... OKcreate file "proj.win32/resource.h" ... OKcreate file "proj.win32/stdafx.cpp" ... OKcreate file "proj.win32/stdafx.h" ... OKcreate file "proj.win32/targetver.h" ... OKcreate file "res/framework_precompiled.zip" ... OKcreate file "scripts/app/MyApp.lua" ... OKcreate file "scripts/app/scenes/MainScene.lua" ... OKcreate file "scripts/config.lua" ... OKcreate file "scripts/main.lua" ... OKcreate file "sources/AppDelegate.cpp" ... OKcreate file "sources/AppDelegate.h" ... OKcreate file "sources/SimulatorConfig.cpp" ... OKcreate file "sources/SimulatorConfig.h" ... OK


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

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


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

感谢那些分享技术心得、写博客的博主。真诚的感谢你们带给我的成长。


0 0
原创粉丝点击