Skip to content

Commit

Permalink
Merge pull request #28 from cocos2d/master
Browse files Browse the repository at this point in the history
update cocos2d-js
  • Loading branch information
cocoscodeide committed May 26, 2014
2 parents b314609 + 4dae357 commit 2b24a38
Show file tree
Hide file tree
Showing 15 changed files with 41 additions and 106 deletions.
6 changes: 0 additions & 6 deletions build/cocos2d_jsb_samples.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,6 @@
BAC50CBD1924AEFF00C57B6B /* jsb_ext_create_apis.js in Resources */ = {isa = PBXBuildFile; fileRef = BAC50CBB1924AEFF00C57B6B /* jsb_ext_create_apis.js */; };
BAC50CBE1924AEFF00C57B6B /* jsb_ext_create_apis.js in Resources */ = {isa = PBXBuildFile; fileRef = BAC50CBB1924AEFF00C57B6B /* jsb_ext_create_apis.js */; };
BAC50CBF1924AEFF00C57B6B /* jsb_ext_create_apis.js in Resources */ = {isa = PBXBuildFile; fileRef = BAC50CBB1924AEFF00C57B6B /* jsb_ext_create_apis.js */; };
BAD138DF191F1BB0007733DD /* project.manifest in Resources */ = {isa = PBXBuildFile; fileRef = BAD138DE191F1BB0007733DD /* project.manifest */; };
BAD138E0191F1BB0007733DD /* project.manifest in Resources */ = {isa = PBXBuildFile; fileRef = BAD138DE191F1BB0007733DD /* project.manifest */; };
D60AE43817F9143D00757E4B /* CoreMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D60AE43317F7FFE100757E4B /* CoreMotion.framework */; };
ED743D1717D099F10004076B /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EDCC747E17C455FD007B692C /* IOKit.framework */; };
/* End PBXBuildFile section */
Expand Down Expand Up @@ -610,7 +608,6 @@
BAA7DEE218C84F5000D9A10E /* main.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = main.js; path = "../samples/js-tests/main.js"; sourceTree = "<group>"; };
BAA7DEE318C84F5000D9A10E /* project.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = project.json; path = "../samples/js-tests/project.json"; sourceTree = "<group>"; };
BAC50CBB1924AEFF00C57B6B /* jsb_ext_create_apis.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = jsb_ext_create_apis.js; path = "../frameworks/js-bindings/bindings/script/jsb_ext_create_apis.js"; sourceTree = "<group>"; };
BAD138DE191F1BB0007733DD /* project.manifest */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = project.manifest; path = "../samples/js-tests/project.manifest"; sourceTree = "<group>"; };
D60AE43317F7FFE100757E4B /* CoreMotion.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMotion.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library/Frameworks/CoreMotion.framework; sourceTree = DEVELOPER_DIR; };
EDCC747E17C455FD007B692C /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = System/Library/Frameworks/IOKit.framework; sourceTree = SDKROOT; };
/* End PBXFileReference section */
Expand Down Expand Up @@ -863,7 +860,6 @@
1A604F2E18BF1D3300CC9A93 /* js-tests */ = {
isa = PBXGroup;
children = (
BAD138DE191F1BB0007733DD /* project.manifest */,
BAA7DEE218C84F5000D9A10E /* main.js */,
1A2B72DA18D294AE00ED9E74 /* project */,
BAA7DEE318C84F5000D9A10E /* project.json */,
Expand Down Expand Up @@ -1443,7 +1439,6 @@
A63D2EC818C856BE00B29B8F /* jsb_boot.js in Resources */,
A63D2ECF18C8B36600B29B8F /* jsb_loaders.js in Resources */,
BAA7DEE518C84F5000D9A10E /* main.js in Resources */,
BAD138E0191F1BB0007733DD /* project.manifest in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -1459,7 +1454,6 @@
BAA7DEE618C84F5000D9A10E /* project.json in Resources */,
1A487B6C18BF3EDF007EEB98 /* jsb.js in Resources */,
1A487B6D18BF3EDF007EEB98 /* jsb_chipmunk.js in Resources */,
BAD138DF191F1BB0007733DD /* project.manifest in Resources */,
1A487B6E18BF3EDF007EEB98 /* jsb_chipmunk_constants.js in Resources */,
1A487B6F18BF3EDF007EEB98 /* jsb_cocos2d.js in Resources */,
1A487B7018BF3EDF007EEB98 /* jsb_cocos2d_constants.js in Resources */,
Expand Down
47 changes: 0 additions & 47 deletions samples/js-tests/project.manifest

This file was deleted.

Binary file added samples/js-tests/res/Images/background1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added samples/js-tests/res/Images/background2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added samples/js-tests/res/Images/background3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
},

"searchPaths" : [
"res/"
"../../../res/"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
},

"searchPaths" : [
"res/"
"../../../res/"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
},

"searchPaths" : [
"res/"
"../../../res/"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ var AssetsManagerTestScene = TestScene.extend({

var AssetsManagerLoaderScene = TestScene.extend({
_am : null,
_progress : null,
_percent : 0,

runThisTest : function () {
var manifestPath = sceneManifests[currentScene];
Expand All @@ -108,10 +110,10 @@ var AssetsManagerLoaderScene = TestScene.extend({
icon.y = cc.winSize.height/2;
layer.addChild(icon);

var progress = new cc.LabelTTF("0%", "Arial", 30);
progress.x = cc.winSize.width/2;
progress.y = cc.winSize.height/2 + 50;
layer.addChild(progress);
this._progress = new cc.LabelTTF("0%", "Arial", 30);
this._progress.x = cc.winSize.width/2;
this._progress.y = cc.winSize.height/2 + 50;
layer.addChild(this._progress);

this._am = new cc.AssetsManager(manifestPath, storagePath);
this._am.retain();
Expand All @@ -124,6 +126,7 @@ var AssetsManagerLoaderScene = TestScene.extend({
}
else
{
var that = this;
var listener = new cc.EventListenerAssetsManager(this._am, function(event) {
var scene;
switch (event.getEventCode())
Expand All @@ -135,8 +138,7 @@ var AssetsManagerLoaderScene = TestScene.extend({
scene.release();
break;
case cc.EventAssetsManager.UPDATE_PROGRESSION:
var percent = event.getPercent();
progress.string = ""+percent;
that._percent = event.getPercent();
break;
case cc.EventAssetsManager.ERROR_DOWNLOAD_MANIFEST:
case cc.EventAssetsManager.ERROR_PARSE_MANIFEST:
Expand Down Expand Up @@ -166,6 +168,12 @@ var AssetsManagerLoaderScene = TestScene.extend({

cc.director.runScene(this);
}

this.schedule(this.updateProgress, 0.5);
},

updateProgress : function(dt){
this._progress.string = "" + this._percent;
},

onExit : function () {
Expand Down
3 changes: 3 additions & 0 deletions samples/js-tests/src/GUITest/UIListViewTest/UIListViewTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ var UIListViewTest_Vertical = UIScene.extend({
var default_item = ccui.Layout.create();
default_item.setTouchEnabled(true);
default_item.setSize(default_button.getSize());
default_item.width = listView.width;
default_button.x = default_item.width / 2;
default_button.y = default_item.height / 2;
default_item.addChild(default_button);
Expand Down Expand Up @@ -86,6 +87,7 @@ var UIListViewTest_Vertical = UIScene.extend({

var custom_item = ccui.Layout.create();
custom_item.setSize(custom_button.getSize());
custom_item.width = listView.width;
custom_button.x = custom_item.width / 2;
custom_button.y = custom_item.height / 2;
custom_item.addChild(custom_button);
Expand All @@ -105,6 +107,7 @@ var UIListViewTest_Vertical = UIScene.extend({

var custom_item = ccui.Layout.create();
custom_item.setSize(custom_button.getSize());
custom_item.width = listView.width;
custom_button.x = custom_item.width / 2;
custom_button.y = custom_item.height / 2;
custom_item.addChild(custom_button);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@
A922754C1517C094001B78AA /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A922754B1517C094001B78AA /* UIKit.framework */; };
A922754E1517C094001B78AA /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A922754D1517C094001B78AA /* Foundation.framework */; };
A92275501517C094001B78AA /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A922754F1517C094001B78AA /* CoreGraphics.framework */; };
BA6FEC4C19335FF300F5D174 /* jsb_ext_create_apis.js in Sources */ = {isa = PBXBuildFile; fileRef = BA6FEC4B19335FF300F5D174 /* jsb_ext_create_apis.js */; };
BA6FEC4D19335FF300F5D174 /* jsb_ext_create_apis.js in Resources */ = {isa = PBXBuildFile; fileRef = BA6FEC4B19335FF300F5D174 /* jsb_ext_create_apis.js */; };
C03780EB18BEE0E400FE4F13 /* src in Resources */ = {isa = PBXBuildFile; fileRef = C03780EA18BEE0E400FE4F13 /* src */; };
C03780EC18BEE0E400FE4F13 /* src in Resources */ = {isa = PBXBuildFile; fileRef = C03780EA18BEE0E400FE4F13 /* src */; };
C037820C18BF77C500FE4F13 /* libjsbindings iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C037820918BF76AF00FE4F13 /* libjsbindings iOS.a */; };
Expand Down Expand Up @@ -317,6 +319,7 @@
A922754B1517C094001B78AA /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
A922754D1517C094001B78AA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
A922754F1517C094001B78AA /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
BA6FEC4B19335FF300F5D174 /* jsb_ext_create_apis.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = jsb_ext_create_apis.js; path = "../../js-bindings/bindings/script/jsb_ext_create_apis.js"; sourceTree = "<group>"; };
C03780EA18BEE0E400FE4F13 /* src */ = {isa = PBXFileReference; lastKnownFileType = folder; name = src; path = ../../../src; sourceTree = "<group>"; };
C037820118BF76AF00FE4F13 /* cocos2d_js_bindings.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = cocos2d_js_bindings.xcodeproj; path = "../../js-bindings/bindings/proj.ios_mac/cocos2d_js_bindings.xcodeproj"; sourceTree = "<group>"; };
C06E23CB18CEFE680093C81A /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = "<group>"; };
Expand Down Expand Up @@ -524,6 +527,7 @@
C0F9A1A218C6D1FC00C75ABD /* jsb_cocos2d_studio.js */,
C0F9A1A418C6D1FC00C75ABD /* jsb_cocosbuilder.js */,
1AC34A0E18C99CA5007834C9 /* jsb_create_apis.js */,
BA6FEC4B19335FF300F5D174 /* jsb_ext_create_apis.js */,
C0F9A1A518C6D1FC00C75ABD /* jsb_debugger.js */,
C0F9A1A618C6D1FC00C75ABD /* jsb_deprecated.js */,
1AC34A0F18C99CA5007834C9 /* jsb_loaders.js */,
Expand Down Expand Up @@ -747,6 +751,7 @@
1AD7E0A918C9DBE3004817A6 /* main.js in Resources */,
1AD7E0A118C9DB84004817A6 /* jsb_boot.js in Resources */,
1AD7E0A218C9DB84004817A6 /* jsb_create_apis.js in Resources */,
BA6FEC4D19335FF300F5D174 /* jsb_ext_create_apis.js in Resources */,
1AD7E0A318C9DB84004817A6 /* jsb_loaders.js in Resources */,
C0F9A1BC18C6D1FC00C75ABD /* jsb_cocos2d.js in Resources */,
C0F9A1C418C6D1FC00C75ABD /* jsb_opengl_constants.js in Resources */,
Expand Down Expand Up @@ -836,6 +841,7 @@
D4545227156E28EF00887EB5 /* AppDelegate.cpp in Sources */,
509D4AC817EBB2AB00697056 /* main.m in Sources */,
509D4ABC17EBB2AB00697056 /* AppController.mm in Sources */,
BA6FEC4C19335FF300F5D174 /* jsb_ext_create_apis.js in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -913,7 +919,7 @@
LIBRARY_SEARCH_PATHS = "";
OTHER_LDFLAGS = "";
SDKROOT = macosx;
USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../../js-bindings/cocos2d-x/cocos/2d/platform/mac $(SRCROOT)/../../js-bindings/cocos2d-x/external/glfw3/include/mac $(SRCROOT)/../../js-bindings/external/spidermonkey/include/mac";
USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../../js-bindings/cocos2d-x/cocos/platform/mac $(SRCROOT)/../../js-bindings/cocos2d-x/external/glfw3/include/mac $(SRCROOT)/../../js-bindings/external/spidermonkey/include/mac";
};
name = Debug;
};
Expand All @@ -934,7 +940,7 @@
LIBRARY_SEARCH_PATHS = "";
OTHER_LDFLAGS = "";
SDKROOT = macosx;
USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../../js-bindings/cocos2d-x/cocos/2d/platform/mac $(SRCROOT)/../../js-bindings/cocos2d-x/external/glfw3/include/mac $(SRCROOT)/../../js-bindings/external/spidermonkey/include/mac";
USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../../js-bindings/cocos2d-x/cocos/platform/mac $(SRCROOT)/../../js-bindings/cocos2d-x/external/glfw3/include/mac $(SRCROOT)/../../js-bindings/external/spidermonkey/include/mac";
};
name = Release;
};
Expand Down Expand Up @@ -1006,7 +1012,7 @@
OTHER_LDFLAGS = "";
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../../js-bindings/cocos2d-x/cocos/2d/platform/ios $(SRCROOT)/../../js-bindings/external/spidermonkey/include/ios";
USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../../js-bindings/cocos2d-x/cocos/platform/ios $(SRCROOT)/../../js-bindings/external/spidermonkey/include/ios";
};
name = Debug;
};
Expand All @@ -1029,7 +1035,7 @@
OTHER_LDFLAGS = "";
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../../js-bindings/cocos2d-x/cocos/2d/platform/ios $(SRCROOT)/../../js-bindings/external/spidermonkey/include/ios";
USER_HEADER_SEARCH_PATHS = "$(inherited) $(SRCROOT)/../../js-bindings/cocos2d-x/cocos/platform/ios $(SRCROOT)/../../js-bindings/external/spidermonkey/include/ios";
};
name = Release;
};
Expand Down
Loading

0 comments on commit 2b24a38

Please sign in to comment.