test template lua

This commit is contained in:
chuanweizhang 2014-01-06 14:24:33 +08:00
parent 0f374ce838
commit 07e51e2c86
8 changed files with 37 additions and 8 deletions

View File

@ -30,7 +30,7 @@ How to start a new game
Example:
$ cd cocos2d-x/tools/project-creator
$ ./project-creator.pyw -n mygame -k com.your_company.mygame -l cpp -p /home/mygame
$ ./project-creator.py -n mygame -k com.your_company.mygame -l cpp -p /home/mygame
$ cd /home/mygame

View File

@ -7,6 +7,12 @@
objects = {
/* Begin PBXBuildFile section */
01A8D331187A504A001CC002 /* CocoStudio.lua in Resources */ = {isa = PBXBuildFile; fileRef = 01A8D32E187A5049001CC002 /* CocoStudio.lua */; };
01A8D332187A504A001CC002 /* CocoStudio.lua in Resources */ = {isa = PBXBuildFile; fileRef = 01A8D32E187A5049001CC002 /* CocoStudio.lua */; };
01A8D333187A504A001CC002 /* extern.lua in Resources */ = {isa = PBXBuildFile; fileRef = 01A8D32F187A504A001CC002 /* extern.lua */; };
01A8D334187A504A001CC002 /* extern.lua in Resources */ = {isa = PBXBuildFile; fileRef = 01A8D32F187A504A001CC002 /* extern.lua */; };
01A8D335187A504A001CC002 /* GuiConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 01A8D330187A504A001CC002 /* GuiConstants.lua */; };
01A8D336187A504A001CC002 /* GuiConstants.lua in Resources */ = {isa = PBXBuildFile; fileRef = 01A8D330187A504A001CC002 /* GuiConstants.lua */; };
15A8A4441834C43700142BE0 /* libchipmunk iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15A8A4291834BDA200142BE0 /* libchipmunk iOS.a */; };
15A8A4451834C43700142BE0 /* libcocos2dx iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15A8A4251834BDA200142BE0 /* libcocos2dx iOS.a */; };
15A8A4461834C43700142BE0 /* libcocos2dx-extensions iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15A8A4271834BDA200142BE0 /* libcocos2dx-extensions iOS.a */; };
@ -219,6 +225,9 @@
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
01A8D32E187A5049001CC002 /* CocoStudio.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = CocoStudio.lua; path = ../cocos2d/cocos/scripting/lua/script/CocoStudio.lua; sourceTree = "<group>"; };
01A8D32F187A504A001CC002 /* extern.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = extern.lua; path = ../cocos2d/cocos/scripting/lua/script/extern.lua; sourceTree = "<group>"; };
01A8D330187A504A001CC002 /* GuiConstants.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = GuiConstants.lua; path = ../cocos2d/cocos/scripting/lua/script/GuiConstants.lua; sourceTree = "<group>"; };
15A8A4031834BDA200142BE0 /* cocos2d_libs.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = cocos2d_libs.xcodeproj; path = ../cocos2d/build/cocos2d_libs.xcodeproj; sourceTree = "<group>"; };
15A8A4551834C6AD00142BE0 /* AudioEngine.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = AudioEngine.lua; path = ../cocos2d/cocos/scripting/lua/script/AudioEngine.lua; sourceTree = "<group>"; };
15A8A4561834C6AD00142BE0 /* CCBReaderLoad.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = CCBReaderLoad.lua; path = ../cocos2d/cocos/scripting/lua/script/CCBReaderLoad.lua; sourceTree = "<group>"; };
@ -370,6 +379,9 @@
1A0227A417A3AA1A00B867AD /* Lua Common */ = {
isa = PBXGroup;
children = (
01A8D32E187A5049001CC002 /* CocoStudio.lua */,
01A8D32F187A504A001CC002 /* extern.lua */,
01A8D330187A504A001CC002 /* GuiConstants.lua */,
15A8A4551834C6AD00142BE0 /* AudioEngine.lua */,
15A8A4561834C6AD00142BE0 /* CCBReaderLoad.lua */,
15A8A4571834C6AD00142BE0 /* Cocos2d.lua */,
@ -722,6 +734,9 @@
5023815717EBBCE400990C9B /* menu2.png in Resources */,
5023817617EBBE3400990C9B /* Icon.icns in Resources */,
15A8A4651834C6AD00142BE0 /* AudioEngine.lua in Resources */,
01A8D332187A504A001CC002 /* CocoStudio.lua in Resources */,
01A8D334187A504A001CC002 /* extern.lua in Resources */,
01A8D336187A504A001CC002 /* GuiConstants.lua in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -772,6 +787,9 @@
5023811A17EBBCAC00990C9B /* Default.png in Resources */,
5091733817ECE17A00D62437 /* Icon-50.png in Resources */,
5023812117EBBCAC00990C9B /* Icon-72.png in Resources */,
01A8D331187A504A001CC002 /* CocoStudio.lua in Resources */,
01A8D333187A504A001CC002 /* extern.lua in Resources */,
01A8D335187A504A001CC002 /* GuiConstants.lua in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};

View File

@ -12,7 +12,7 @@ cd ../cocos2d
sudo ./build/install-deps-linux.sh
mkdir -p linux-build
cd linux-build
cmake .. -DBUILD_LIBS_LUA=OFF -DBUILD_HelloCpp=OFF -DBUILD_TestCpp=OFF -DBUILD_HelloLua=OFF -DBUILD_TestLua=OFF
cmake .. -DBUILD_HelloCpp=OFF -DBUILD_TestCpp=OFF -DBUILD_HelloLua=OFF -DBUILD_TestLua=OFF
make -j4
#make bin
@ -24,3 +24,4 @@ cmake ../..
make -j4
cd ..
mv ../bin bin
cp ../cocos2d/cocos/scripting/lua/script/* bin/Resources

View File

@ -4,6 +4,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HelloLua", "HelloLua.vcxproj", "{4E6A7A0E-DDD8-4BAA-8B22-C964069364ED}"
ProjectSection(ProjectDependencies) = postProject
{21B2C324-891F-48EA-AD1A-5AE13DE12E28} = {21B2C324-891F-48EA-AD1A-5AE13DE12E28}
{B7C2A162-DEC9-4418-972E-240AB3CBFCAE} = {B7C2A162-DEC9-4418-972E-240AB3CBFCAE}
{DDC3E27F-004D-4DD4-9DD3-931A013D2159} = {DDC3E27F-004D-4DD4-9DD3-931A013D2159}
{98A51BA8-FC3A-415B-AC8F-8C7BD464E93E} = {98A51BA8-FC3A-415B-AC8F-8C7BD464E93E}
{207BC7A9-CCF1-4F2F-A04D-45F72242AE25} = {207BC7A9-CCF1-4F2F-A04D-45F72242AE25}
@ -33,6 +34,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libCocosStudio", "..\cocos2
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libGUI", "..\cocos2d\cocos\gui\proj.win32\libGUI.vcxproj", "{7E06E92C-537A-442B-9E4A-4761C84F8A1A}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libSpine", "..\cocos2d\cocos\editor-support\spine\proj.win32\libSpine.vcxproj", "{B7C2A162-DEC9-4418-972E-240AB3CBFCAE}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
@ -79,6 +82,10 @@ Global
{7E06E92C-537A-442B-9E4A-4761C84F8A1A}.Debug|Win32.Build.0 = Debug|Win32
{7E06E92C-537A-442B-9E4A-4761C84F8A1A}.Release|Win32.ActiveCfg = Release|Win32
{7E06E92C-537A-442B-9E4A-4761C84F8A1A}.Release|Win32.Build.0 = Release|Win32
{B7C2A162-DEC9-4418-972E-240AB3CBFCAE}.Debug|Win32.ActiveCfg = Debug|Win32
{B7C2A162-DEC9-4418-972E-240AB3CBFCAE}.Debug|Win32.Build.0 = Debug|Win32
{B7C2A162-DEC9-4418-972E-240AB3CBFCAE}.Release|Win32.ActiveCfg = Release|Win32
{B7C2A162-DEC9-4418-972E-240AB3CBFCAE}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@ -186,6 +186,9 @@ xcopy /Y /Q "$(ProjectDir)..\cocos2d\external\websockets\prebuilt\win32\*.*" "$(
</ProjectReference>
<ProjectReference Include="..\cocos2d\cocos\editor-support\cocostudio\proj.win32\libCocosStudio.vcxproj">
<Project>{b57cf53f-2e49-4031-9822-047cc0e6bde2}</Project>
</ProjectReference>
<ProjectReference Include="..\cocos2d\cocos\editor-support\spine\proj.win32\libSpine.vcxproj">
<Project>{b7c2a162-dec9-4418-972e-240ab3cbfcae}</Project>
</ProjectReference>
<ProjectReference Include="..\cocos2d\cocos\gui\proj.win32\libGUI.vcxproj">
<Project>{7e06e92c-537a-442b-9e4a-4761c84f8a1a}</Project>

View File

@ -5,11 +5,11 @@ First you need install python environment.
There have double ways create new cocos project.
Notice:The best of generate path is english path.
##1.UI
* Windows: double click "create_project.pyw" file
* Mac: ./create_project.pyw
* Windows: double click "create_project.py" file
* Mac: ./create_project.py
* Linux: The tkinter was not installed in the linux's default python,therefore, in order to use the gui operate, you have to install the tkinter libaray manually. There is another way to create project by command line. see below for details
##2.console
$ cd cocos2d-x/tools/project-creator
$ ./project-creator.pyw --help
$ ./project-creator.pyw -n mygame -k com.your_company.mygame -l cpp -p /home/mygame
$ ./project-creator.py --help
$ ./project-creator.py -n mygame -k com.your_company.mygame -l cpp -p /home/mygame
$ cd /home/mygame

View File

@ -1 +1 @@
6b36f5d803952b11046d0b2395c232fe66301b2f
96eb4f261ce2c1be3899e53508952d57bbd19d5d

View File

@ -197,7 +197,7 @@ class CocosProject:
else:
if os.path.exists(dstfile):
os.remove(dstfile)
shutil.copyfile(srcfile, dstfile)
shutil.copy(srcfile, dstfile)
self.step = self.step + 1
if self.callbackfun and self.step%int(self.totalStep/50) == 0:
self.callbackfun(self.step,self.totalStep,fileList[index])