From d643b306efbfcfabec86e004b9da925bda6bd63a Mon Sep 17 00:00:00 2001 From: pandamicro Date: Fri, 24 Jun 2016 13:50:24 +0800 Subject: [PATCH] Remove cocos studio tests in JS-tests --- tests/cpp-tests/Resources/ccs-res | 2 +- tests/js-tests/project.json | 40 - .../ActionTimelineTest/ActionTimelineTest.js | 138 -- .../ArmatureTest/ArmatureTest.js | 1312 ----------------- .../src/CocoStudioTest/CocoStudioTest.js | 152 -- .../ComponentsTest/ComponentsTestScene.js | 77 - .../ComponentsTest/EnemyController.js | 83 -- .../ComponentsTest/GameOverScene.js | 74 - .../ComponentsTest/PlayerController.js | 66 - .../ComponentsTest/ProjectileController.js | 122 -- .../ComponentsTest/SceneController.js | 107 -- .../CustomTest/CustomGUIScene.js | 107 -- .../CustomImageScene/CustomImageScene.js | 67 - .../CustomImageView/CustomImageView.js | 66 - .../CustomImageView/CustomImageViewReader.js | 42 - .../CustomParticWidgetReader.js | 43 - .../CustomImageView/CustomParticleWidget.js | 104 -- .../CustomImageView/CustomReader.js | 43 - .../CustomParticleWidgetTest.js | 74 - .../src/CocoStudioTest/GUITest/UIBaseLayer.js | 70 - .../GUITest/UIButtonTest/UIButtonTest.js | 68 - .../GUITest/UICheckBoxTest/UICheckBoxTest.js | 113 -- .../UIImageViewTest/UIImageViewTest.js | 36 - .../GUITest/UILayoutTest/UILayoutTest.js | 88 -- .../GUITest/UIListViewTest/UIListViewTest.js | 97 -- .../UILoadingBarTest/UILoadingBarTest.js | 55 - .../UINodeContainerTest.js | 41 - .../GUITest/UIPageViewTest/UIPageViewTest.js | 50 - .../GUITest/UIRichTextTest/UIRichTextTest.js | 92 -- .../src/CocoStudioTest/GUITest/UISceneTest.js | 177 --- .../UIScrollViewTest/UIScrollViewTest.js | 84 -- .../GUITest/UISliderTest/UISliderTest.js | 54 - .../UITextAtlasTest/UITextAtlasTest.js | 41 - .../UITextBMFontTest/UITextBMFontTest.js | 37 - .../UITextFieldTest/UITextFieldTest.js | 63 - .../GUITest/UITextTest/UITextTest.js | 37 - .../AnimationsWithOnlyOneFrame.js | 102 -- .../CocoStudioTest/IssueTest/CCSIssueTest.js | 101 -- .../CocoStudioTest/ParserTest/ParserTest.js | 156 -- .../SceneTest/SceneEditorTest.js | 547 ------- .../SceneTest/TriggerCode/Acts.js | 642 -------- .../SceneTest/TriggerCode/Cons.js | 245 --- .../SceneTest/TriggerCode/EventDef.js | 33 - tests/js-tests/src/GUITest/UIScene.js | 10 +- tests/js-tests/src/tests-main.js | 9 - tests/js-tests/src/tests_resources.js | 406 +---- 46 files changed, 5 insertions(+), 6168 deletions(-) delete mode 100644 tests/js-tests/src/CocoStudioTest/ActionTimelineTest/ActionTimelineTest.js delete mode 100644 tests/js-tests/src/CocoStudioTest/ArmatureTest/ArmatureTest.js delete mode 100644 tests/js-tests/src/CocoStudioTest/CocoStudioTest.js delete mode 100644 tests/js-tests/src/CocoStudioTest/ComponentsTest/ComponentsTestScene.js delete mode 100644 tests/js-tests/src/CocoStudioTest/ComponentsTest/EnemyController.js delete mode 100644 tests/js-tests/src/CocoStudioTest/ComponentsTest/GameOverScene.js delete mode 100644 tests/js-tests/src/CocoStudioTest/ComponentsTest/PlayerController.js delete mode 100644 tests/js-tests/src/CocoStudioTest/ComponentsTest/ProjectileController.js delete mode 100644 tests/js-tests/src/CocoStudioTest/ComponentsTest/SceneController.js delete mode 100644 tests/js-tests/src/CocoStudioTest/CustomTest/CustomGUIScene.js delete mode 100644 tests/js-tests/src/CocoStudioTest/CustomTest/CustomImageScene/CustomImageScene.js delete mode 100644 tests/js-tests/src/CocoStudioTest/CustomTest/CustomImageView/CustomImageView.js delete mode 100644 tests/js-tests/src/CocoStudioTest/CustomTest/CustomImageView/CustomImageViewReader.js delete mode 100644 tests/js-tests/src/CocoStudioTest/CustomTest/CustomImageView/CustomParticWidgetReader.js delete mode 100644 tests/js-tests/src/CocoStudioTest/CustomTest/CustomImageView/CustomParticleWidget.js delete mode 100644 tests/js-tests/src/CocoStudioTest/CustomTest/CustomImageView/CustomReader.js delete mode 100644 tests/js-tests/src/CocoStudioTest/CustomTest/CustomParticleWidgetTest/CustomParticleWidgetTest.js delete mode 100644 tests/js-tests/src/CocoStudioTest/GUITest/UIBaseLayer.js delete mode 100644 tests/js-tests/src/CocoStudioTest/GUITest/UIButtonTest/UIButtonTest.js delete mode 100644 tests/js-tests/src/CocoStudioTest/GUITest/UICheckBoxTest/UICheckBoxTest.js delete mode 100644 tests/js-tests/src/CocoStudioTest/GUITest/UIImageViewTest/UIImageViewTest.js delete mode 100644 tests/js-tests/src/CocoStudioTest/GUITest/UILayoutTest/UILayoutTest.js delete mode 100644 tests/js-tests/src/CocoStudioTest/GUITest/UIListViewTest/UIListViewTest.js delete mode 100644 tests/js-tests/src/CocoStudioTest/GUITest/UILoadingBarTest/UILoadingBarTest.js delete mode 100644 tests/js-tests/src/CocoStudioTest/GUITest/UINodeContainerTest/UINodeContainerTest.js delete mode 100644 tests/js-tests/src/CocoStudioTest/GUITest/UIPageViewTest/UIPageViewTest.js delete mode 100644 tests/js-tests/src/CocoStudioTest/GUITest/UIRichTextTest/UIRichTextTest.js delete mode 100644 tests/js-tests/src/CocoStudioTest/GUITest/UISceneTest.js delete mode 100644 tests/js-tests/src/CocoStudioTest/GUITest/UIScrollViewTest/UIScrollViewTest.js delete mode 100644 tests/js-tests/src/CocoStudioTest/GUITest/UISliderTest/UISliderTest.js delete mode 100644 tests/js-tests/src/CocoStudioTest/GUITest/UITextAtlasTest/UITextAtlasTest.js delete mode 100644 tests/js-tests/src/CocoStudioTest/GUITest/UITextBMFontTest/UITextBMFontTest.js delete mode 100644 tests/js-tests/src/CocoStudioTest/GUITest/UITextFieldTest/UITextFieldTest.js delete mode 100644 tests/js-tests/src/CocoStudioTest/GUITest/UITextTest/UITextTest.js delete mode 100644 tests/js-tests/src/CocoStudioTest/IssueTest/AnimationsWithOnlyOneFrame/AnimationsWithOnlyOneFrame.js delete mode 100644 tests/js-tests/src/CocoStudioTest/IssueTest/CCSIssueTest.js delete mode 100644 tests/js-tests/src/CocoStudioTest/ParserTest/ParserTest.js delete mode 100644 tests/js-tests/src/CocoStudioTest/SceneTest/SceneEditorTest.js delete mode 100644 tests/js-tests/src/CocoStudioTest/SceneTest/TriggerCode/Acts.js delete mode 100644 tests/js-tests/src/CocoStudioTest/SceneTest/TriggerCode/Cons.js delete mode 100644 tests/js-tests/src/CocoStudioTest/SceneTest/TriggerCode/EventDef.js diff --git a/tests/cpp-tests/Resources/ccs-res b/tests/cpp-tests/Resources/ccs-res index 50f82c2e07..892e3cbdc2 160000 --- a/tests/cpp-tests/Resources/ccs-res +++ b/tests/cpp-tests/Resources/ccs-res @@ -1 +1 @@ -Subproject commit 50f82c2e0736d127e0b58fef0d8b773af90a7f3d +Subproject commit 892e3cbdc27d24c39c62d700a81be27e593823b7 diff --git a/tests/js-tests/project.json b/tests/js-tests/project.json index 90694f304f..283c723d47 100644 --- a/tests/js-tests/project.json +++ b/tests/js-tests/project.json @@ -110,41 +110,6 @@ "src/ExtensionsTest/PluginXTest/PluginXTestsManager.js", "src/ExtensionsTest/PluginXTest/IOSIAPTest.js", "src/ExtensionsTest/PluginXTest/AnalyticsTest.js", - "src/CocoStudioTest/ArmatureTest/ArmatureTest.js", - "src/CocoStudioTest/ComponentsTest/ComponentsTestScene.js", - "src/CocoStudioTest/ComponentsTest/EnemyController.js", - "src/CocoStudioTest/ComponentsTest/GameOverScene.js", - "src/CocoStudioTest/ComponentsTest/PlayerController.js", - "src/CocoStudioTest/ComponentsTest/ProjectileController.js", - "src/CocoStudioTest/ComponentsTest/SceneController.js", - "src/CocoStudioTest/GUITest/UISceneTest.js", - "src/CocoStudioTest/GUITest/UIBaseLayer.js", - "src/CocoStudioTest/GUITest/UIButtonTest/UIButtonTest.js", - "src/CocoStudioTest/GUITest/UICheckBoxTest/UICheckBoxTest.js", - "src/CocoStudioTest/GUITest/UIImageViewTest/UIImageViewTest.js", - "src/CocoStudioTest/GUITest/UITextTest/UITextTest.js", - "src/CocoStudioTest/GUITest/UITextAtlasTest/UITextAtlasTest.js", - "src/CocoStudioTest/GUITest/UITextBMFontTest/UITextBMFontTest.js", - "src/CocoStudioTest/GUITest/UILoadingBarTest/UILoadingBarTest.js", - "src/CocoStudioTest/GUITest/UISliderTest/UISliderTest.js", - "src/CocoStudioTest/GUITest/UITextFieldTest/UITextFieldTest.js", - "src/CocoStudioTest/GUITest/UINodeContainerTest/UINodeContainerTest.js", - "src/CocoStudioTest/GUITest/UILayoutTest/UILayoutTest.js", - "src/CocoStudioTest/GUITest/UIListViewTest/UIListViewTest.js", - "src/CocoStudioTest/GUITest/UIPageViewTest/UIPageViewTest.js", - "src/CocoStudioTest/GUITest/UIScrollViewTest/UIScrollViewTest.js", - "src/CocoStudioTest/ParserTest/ParserTest.js", - "src/CocoStudioTest/CustomTest/CustomImageView/CustomImageView.js", - "src/CocoStudioTest/CustomTest/CustomImageView/CustomImageViewReader.js", - "src/CocoStudioTest/CustomTest/CustomImageView/CustomParticleWidget.js", - "src/CocoStudioTest/CustomTest/CustomImageView/CustomParticWidgetReader.js", - "src/CocoStudioTest/CustomTest/CustomImageView/CustomReader.js", - "src/CocoStudioTest/CustomTest/CustomParticleWidgetTest/CustomParticleWidgetTest.js", - "src/CocoStudioTest/CustomTest/CustomImageScene/CustomImageScene.js", - "src/CocoStudioTest/CustomTest/CustomGUIScene.js", - "src/CocoStudioTest/ActionTimelineTest/ActionTimelineTest.js", - "src/CocoStudioTest/IssueTest/AnimationsWithOnlyOneFrame/AnimationsWithOnlyOneFrame.js", - "src/CocoStudioTest/IssueTest/CCSIssueTest.js", "src/GUITest/UIScene.js", "src/GUITest/UIButtonTest/UIButtonTest.js", "src/GUITest/UICheckBoxTest/UICheckBoxTest.js", @@ -168,11 +133,6 @@ "src/GUITest/UIWebViewTest/UIWebViewTest.js", "src/GUITest/UIS9NinePatchTest/UIS9NinePatchTest.js", - "src/CocoStudioTest/SceneTest/TriggerCode/Acts.js", - "src/CocoStudioTest/SceneTest/TriggerCode/Cons.js", - "src/CocoStudioTest/SceneTest/TriggerCode/EventDef.js", - "src/CocoStudioTest/SceneTest/SceneEditorTest.js", - "src/CocoStudioTest/CocoStudioTest.js", "src/XHRTest/XHRTest.js", "src/XHRTest/XHRArrayBufferTest.js", diff --git a/tests/js-tests/src/CocoStudioTest/ActionTimelineTest/ActionTimelineTest.js b/tests/js-tests/src/CocoStudioTest/ActionTimelineTest/ActionTimelineTest.js deleted file mode 100644 index cc50e8f156..0000000000 --- a/tests/js-tests/src/CocoStudioTest/ActionTimelineTest/ActionTimelineTest.js +++ /dev/null @@ -1,138 +0,0 @@ -/**************************************************************************** - Copyright (c) 2013-2016 Chukong Technologies Inc. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -var runActionTimeLineTest; - -(function(){ - - runActionTimeLineTest = function(){ - var scene = new cc.Scene(); - scene.addChild(new layer); - cc.director.runScene(scene); - }; - - var layer = cc.Layer.extend({ - - ctor: function(){ - cc.Layer.prototype.ctor.call(this); - - var json = ccs.load("ActionTimeline/DemoPlayer_skeleton.json"); - - var node = json.node, action = json.action; - - node.x = 200; - node.y = 160; - node.setScale(0.2); - this.addChild(node); - node.setDebugDrawEnabled(true); - if (action) { - node.runAction(action); - action.gotoFrameAndPlay(0, 40, true); - } - - this.createMenu(node, action); - }, - - createMenu: function(node, action){ - var menus = []; - - action.addAnimationInfo(new ccs.AnimationInfo("stand", 0, 40)); - action.addAnimationInfo(new ccs.AnimationInfo("walk", 41, 81)); - - var items = [ - { - title: "debug", - callback: function(){ - node.setDebugDrawEnabled(!node.isDebugDrawEnabled()); - } - },{ - title: "change animation", - callback: function(){ - if(action.getStartFrame() == 0) - action.gotoFrameAndPlay(41, 81, true); - else - action.gotoFrameAndPlay(0, 40, true); - } - },/*{ - title: "set Frame callback", - callback: function(evnt){ - action.setFrameEventCallFunc(function(){ - if("" == "changeColor"){ - evnt.getNode().setColor(cc.color(0,0,0)); - }else{ - evnt.getNode().setColor(cc.color(255,255,255)); - } - }, this); - } - },*/{ - title: "AnimationList: walk", - callback: function(){ - action.play("walk", true); - } - },{ - title: "AnimationList: stand", - callback: function(){ - action.play("stand", true); - } - },{ - title: "change skin", - callback: function(){ - if (weapSkinToAdd.isVisible()) - weaponHandeBone.displaySkin("3", true); - else - weaponHandeBone.displaySkin(weapSkinToAdd, true); - } - } - - ]; - - var weaponHandeBone = node.getBoneNode("Layer20"); - var weapSkinToAdd = new cc.Sprite("ActionTimeline/testAnimationResource/girl_arms.png"); - weapSkinToAdd.setName("Knife"); - weapSkinToAdd.setPosition(cc.p(135, 23)); - weapSkinToAdd.setScale(3.0); - weapSkinToAdd.setRotation(86); - weaponHandeBone.addSkin(weapSkinToAdd, false); - - - items.forEach(function(item, index){ - var menuItem = new cc.MenuItemFont(item.title, item.callback, this); - menuItem.setPosition((index / 7 | 0) * 100, 120 - index % 7 * 30); - menus.push(menuItem); - }); - var menuItem = new cc.MenuItemFont("Back", function(){ - var scene = new CocoStudioTestScene(); - scene.runThisTest(); - }, this); - menuItem.setPosition(325, -175); - menus.push(menuItem); - - var menu = new cc.Menu(menus); - this.addChild(menu); - } - - - }); - -})(); \ No newline at end of file diff --git a/tests/js-tests/src/CocoStudioTest/ArmatureTest/ArmatureTest.js b/tests/js-tests/src/CocoStudioTest/ArmatureTest/ArmatureTest.js deleted file mode 100644 index 5a1940c02f..0000000000 --- a/tests/js-tests/src/CocoStudioTest/ArmatureTest/ArmatureTest.js +++ /dev/null @@ -1,1312 +0,0 @@ -/**************************************************************************** - Copyright (c) 2008-2010 Ricardo Quesada - Copyright (c) 2011-2012 cocos2d-x.org - Copyright (c) 2013-2014 Chukong Technologies Inc. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -var armatureSceneIdx = -1; - -var ArmatureTestScene = TestScene.extend({ - onEnter:function(){ - this._super(); - }, - runThisTest:function () { - armatureSceneIdx = -1; - this.addChild(nextArmatureTest()); - director.runScene(this); - }, - onMainMenuCallback:function(){ - this.removeAllChildren(); - ccs.armatureDataManager.clear(); - var scene = new CocoStudioTestScene(); - scene.runThisTest(); - }, - onExit:function () { - this._super(); - } -}); - -var armatureSceneArr = [ - function () { - return new TestAsynchronousLoading(); - }, - function () { - return new TestDirectLoading(); - }, - function () { - return new TestCSWithSkeleton(); - }, - function () { - return new TestDragonBones20(); - }, - function () { - return new TestPerformance(); - }, - function () { - return new TestChangeZorder(); - }, - function () { - return new TestAnimationEvent(); - }, - function () { - return new TestFrameEvent(); - }, - function () { - return new TestParticleDisplay(); - }, - function () { - return new TestUseMutiplePicture(); - }, - function () { - return new TestBoundingBox(); - }, - function () { - return new TestAnchorPoint(); - }, - function () { - return new TestArmatureNesting(); - }, - function () { - return new TestArmatureNesting2(); - }, - function(){ - return new TestPlaySeveralMovement(); - }, - function(){ - return new TestEasing(); - }, - function(){ - return new TestCalculatedVertex(); - } -]; - -if (!cc.sys.isNative) -{ - armatureSceneArr.push( function () { return new TestColliderDetector();} ); -}else{ - //armatureSceneArr.push( function () { return new TestPerformanceBatchNode();} ); - armatureSceneArr.push( function () { return new TestChangeAnimationInternal();} ); -} - -var nextArmatureTest = function () { - armatureSceneIdx++; - armatureSceneIdx = armatureSceneIdx % armatureSceneArr.length; - return armatureSceneArr[armatureSceneIdx](); -}; - -var backArmatureTest = function () { - armatureSceneIdx--; - if (armatureSceneIdx < 0) - armatureSceneIdx += armatureSceneArr.length; - - return armatureSceneArr[armatureSceneIdx](); -}; - -var restartArmatureTest = function () { - return armatureSceneArr[armatureSceneIdx](); -}; -var ArmatureTestLayer = BaseTestLayer.extend({ - ctor:function () { - if (arguments.length === 0) { - this._super(cc.color(0, 0, 0, 255), cc.color(98, 99, 117, 255)); - } else { - this._super.apply(this, arguments); - } - }, - - onRestartCallback:function (sender) { - var s = new ArmatureTestScene(); - s.addChild(restartArmatureTest()); - director.runScene(s); - }, - - onNextCallback:function (sender) { - var s = new ArmatureTestScene(); - s.addChild(nextArmatureTest()); - director.runScene(s); - }, - - onBackCallback:function (sender) { - var s = new ArmatureTestScene(); - s.addChild(backArmatureTest()); - director.runScene(s); - } -}); - - -//------------------------------------------------------------------ -// -// TestAsynchronousLoading -// -//------------------------------------------------------------------ -var TestAsynchronousLoading = ArmatureTestLayer.extend({ - onEnter: function () { - this._super(); - this.setMenuItemEnabled(false); - var armatureDataManager = ccs.armatureDataManager; - armatureDataManager.addArmatureFileInfoAsync(s_knight_png, s_knight_plist, s_knight_xml, this.dataLoaded, this); - armatureDataManager.addArmatureFileInfoAsync(s_weapon_png, s_weapon_plist, s_weapon_xml, this.dataLoaded, this); - armatureDataManager.addArmatureFileInfoAsync(s_robot_png, s_robot_plist, s_robot_xml, this.dataLoaded, this); - armatureDataManager.addArmatureFileInfoAsync(s_cyborg_png, s_cyborg_plist, s_cyborg_xml,this.dataLoaded, this); - armatureDataManager.addArmatureFileInfoAsync(s_Dragon_png, s_Dragon_plist, s_Dragon_xml, this.dataLoaded, this); - armatureDataManager.addArmatureFileInfoAsync(s_Cowboy_json, this.dataLoaded, this); - armatureDataManager.addArmatureFileInfoAsync(s_hero_json, this.dataLoaded, this); - armatureDataManager.addArmatureFileInfoAsync(s_horse_json, this.dataLoaded, this); - armatureDataManager.addArmatureFileInfoAsync(s_bear_json, this.dataLoaded, this); - armatureDataManager.addArmatureFileInfoAsync(s_HeroAnimation_json, this.dataLoaded, this); - }, - setMenuItemEnabled: function (bool) { - var menu = this.getChildByTag(BASE_TEST_MENU_TAG); - var backItem = menu.getChildByTag(BASE_TEST_MENUITEM_PREV_TAG); - var restartItem = menu.getChildByTag(BASE_TEST_MENUITEM_RESET_TAG); - var nextItem = menu.getChildByTag(BASE_TEST_MENUITEM_NEXT_TAG); - backItem.enabled = bool; - restartItem.enabled = bool; - nextItem.enabled = bool; - }, - title: function () { - return "Test Asynchronous Loading"; - }, - subtitle: function () { - return "current percent : 0"; - }, - restartCallback: function (sender) { - ccs.armatureDataManager.clear(); - this._super(sender); - }, - dataLoaded: function (percent) { - cc.log("percent:" + percent); - var subTile = this.getChildByTag(BASE_TEST_SUBTITLE_TAG); - subTile.setString("current percent : " + (percent.toFixed(2) * 100)); - if (percent >= 1) { - this.setMenuItemEnabled(true); - } - } -}); - -//------------------------------------------------------------------ -// -// TestDirectLoading -// -//------------------------------------------------------------------ -var TestDirectLoading = ArmatureTestLayer.extend({ - onEnter:function () { - this._super(); - // remove sigle resource - ccs.armatureDataManager.removeArmatureFileInfo(s_bear_json); - // load resource directly - ccs.armatureDataManager.addArmatureFileInfo(s_bear_json); - - var armature = new ccs.Armature("bear"); - armature.getAnimation().playWithIndex(0); - armature.anchorX = 0.5; - armature.anchorY = 0.5; - armature.x = winSize.width / 2; - armature.y = winSize.height / 2; - armature.runAction(cc.sequence(cc.tintTo(5, 200,100,0), cc.tintTo(5, 255,255,255))); - this.addChild(armature); - }, - title:function () { - return "Test Direct Loading"; - } -}); - -//------------------------------------------------------------------ -// -// TestCSWithSkeleton -// -//------------------------------------------------------------------ -var TestCSWithSkeleton = ArmatureTestLayer.extend({ - onEnter:function () { - this._super(); - ccs.armatureDataManager.addArmatureFileInfo(s_Cowboy_json); - - var armature = new ccs.Armature("Cowboy"); - armature.getAnimation().playWithIndex(0); - armature.scale = 0.2; - armature.anchorX = 0.5; - armature.anchorY = 0.5; - armature.x = winSize.width / 2; - armature.y = winSize.height / 2; - this.addChild(armature); - }, - title:function () { - return "Test Export From CocoStudio With Skeleton Effect"; - } -}); - -//------------------------------------------------------------------ -// -// TestDragonBones20 -// -//------------------------------------------------------------------ -var TestDragonBones20 = ArmatureTestLayer.extend({ - onEnter:function () { - this._super(); - ccs.armatureDataManager.addArmatureFileInfo(s_Dragon_png, s_Dragon_plist, s_Dragon_xml); - var armature = new ccs.Armature("Dragon"); - armature.getAnimation().playWithIndex(0); - armature.getAnimation().setSpeedScale(0.4); - armature.scale = 0.6; - armature.anchorX = 0.5; - armature.anchorY = 0.5; - armature.x = winSize.width / 2; - armature.y = winSize.height / 2; - this.addChild(armature); - }, - title:function () { - return "Test Export From DragonBones version 2.0"; - } -}); - -//------------------------------------------------------------------ -// -// TestPerformance -// -//------------------------------------------------------------------ -var ArmaturePerformanceTag = 20000; -var TestPerformance = ArmatureTestLayer.extend({ - armatureCount: 0, - onEnter: function () { - this._super(); - ccs.armatureDataManager.addArmatureFileInfo(s_knight_png, s_knight_plist, s_knight_xml); - cc.MenuItemFont.setFontSize(65); - var decrease = new cc.MenuItemFont(" - ", this.onDecrease, this); - decrease.color = cc.color(0, 200, 20); - var increase = new cc.MenuItemFont(" + ", this.onIncrease, this); - increase.color = cc.color(0, 200, 20); - - var menu = new cc.Menu(decrease, increase); - menu.alignItemsHorizontally(); - menu.x = cc.visibleRect.width / 2; - menu.y = cc.visibleRect.height - 100; - this.addChild(menu, 10000); - - }, - title: function () { - return "Test Performance"; - }, - subtitle: function () { - return "Current CCArmature Count :"; - }, - onIncrease: function (sender) { - this.addArmature(20); - }, - onDecrease: function (sender) { - if (this.armatureCount == 0) - return; - - for (var i = 0; i < 20; i++) { - this.removeArmatureFromParent(ArmaturePerformanceTag + this.armatureCount); - this.armatureCount--; - this.refreshTitile(); - } - }, - addArmature: function (number) { - for (var i = 0; i < number; i++) { - this.armatureCount++; - var armature = new ccs.Armature("Knight_f/Knight"); - armature.getAnimation().playWithIndex(0); - armature.x = 50 + this.armatureCount * 2; - armature.y = 150; - armature.scale = 0.6; - this.addArmatureToParent(armature); - } - this.refreshTitile(); - }, - addArmatureToParent: function (armature) { - this.addChild(armature, 0, ArmaturePerformanceTag + this.armatureCount); - }, - removeArmatureFromParent: function (tag) { - this.removeChildByTag(tag); - }, - refreshTitile: function () { - var subTile = this.getChildByTag(BASE_TEST_SUBTITLE_TAG); - subTile.setString(this.subtitle() + this.armatureCount); - } -}); - -//------------------------------------------------------------------ -// -// TestPerformanceBatchNode -// -//------------------------------------------------------------------ -var TestPerformanceBatchNode = TestPerformance.extend({ - batchNode: null, - onEnter: function () { - this._super(); - this.batchNode = new ccs.BatchNode(); - this.addChild(this.batchNode); - }, - title: function () { - return "Test Performance of using CCBatchNode"; - }, - addArmatureToParent: function (armature) { - this.batchNode.addChild(armature, 0, ArmaturePerformanceTag + this.armatureCount); - }, - removeArmatureFromParent: function (tag) { - this.batchNode.removeChildByTag(tag); - } -}); - -//------------------------------------------------------------------ -// -// TestChangeZorder -// -//------------------------------------------------------------------ -var TestChangeZorder = ArmatureTestLayer.extend({ - currentTag:0, - onEnter:function () { - this._super(); - var armature = null; - var armatureDataManager = ccs.armatureDataManager; - armatureDataManager.addArmatureFileInfo(s_knight_png, s_knight_plist, s_knight_xml); - armature = new ccs.Armature("Knight_f/Knight"); - armature.getAnimation().playWithIndex(0); - armature.x = winSize.width / 2; - armature.y = winSize.height / 2 - 100; - armature.scale = 0.6; - this.addChild(armature, 0, 0); - - armatureDataManager.addArmatureFileInfo(s_Cowboy_json); - armature = new ccs.Armature("Cowboy"); - armature.getAnimation().playWithIndex(0); - armature.scale = 0.24; - armature.x = winSize.width / 2; - armature.y = winSize.height / 2 - 100; - this.addChild(armature, 1, 1); - - armatureDataManager.addArmatureFileInfo(s_Dragon_png, s_Dragon_plist, s_Dragon_xml); - armature = new ccs.Armature("Dragon"); - armature.getAnimation().playWithIndex(0); - armature.x = winSize.width / 2; - armature.y = winSize.height / 2 - 100; - armature.scale = 0.6; - this.addChild(armature, 2, 2); - - this.schedule(this.changeZorder, 1); - }, - title:function () { - return "Test Change ZOrder Of Different CCArmature"; - }, - changeZorder:function (dt) { - var node = this.getChildByTag(this.currentTag); - node.zIndex = Math.random() * 3; - this.currentTag++; - this.currentTag = this.currentTag % 3; - } - -}); - -//------------------------------------------------------------------ -// -// TestAnimationEvent -// -//------------------------------------------------------------------ -var TestAnimationEvent = ArmatureTestLayer.extend({ - _armature:null, - _direction:1, - onEnter:function () { - this._super(); - - ccs.armatureDataManager.addArmatureFileInfo(s_Cowboy_json); - this._armature = new ccs.Armature("Cowboy"); - this._armature.getAnimation().play("Fire"); - this._armature.scaleX = -0.25; - this._armature.scaleY = 0.25; - this._armature.x = winSize.width / 2 - 150; - this._armature.y = winSize.height / 2; - var self = this; - this._armature.getAnimation().setMovementEventCallFunc(function(armature, movementType, movementID) { - self.animationEvent(armature, movementType, movementID); - }); - this.addChild(this._armature); - - this._direction = 1; - - }, - title:function () { - return "Test Armature Animation Event"; - }, - animationEvent:function (armature, movementType, movementID) { - if (movementType == ccs.MovementEventType.loopComplete) { - if (movementID == "Fire") { - var moveBy = cc.moveBy(2, cc.p(300 * this._direction, 0)); - this._armature.stopAllActions(); - var callFunc = cc.callFunc(this.callback, this); - this._armature.runAction(cc.sequence(moveBy, callFunc)); - this._armature.getAnimation().play("Walk"); - - this._direction *= -1; - } - } - }, - callback:function () { - this._armature.runAction(cc.scaleTo(0.3, 0.25 * this._direction * -1, 0.25)); - this._armature.getAnimation().play("Fire", 10); - } -}); - -//------------------------------------------------------------------ -// -// TestAnimationEvent -// -//------------------------------------------------------------------ - -var FRAME_EVENT_ACTION_TAG = 10000; -var TestFrameEvent = ArmatureTestLayer.extend({ - _nodeGrid: null, - onEnter: function () { - this._super(); - ccs.armatureDataManager.addArmatureFileInfo(s_HeroAnimation_json); - var armature = new ccs.Armature("HeroAnimation"); - armature.getAnimation().play("attack"); - armature.getAnimation().setSpeedScale(0.5); - var center = cc.visibleRect.center; - armature.x = center.x - 50; - armature.y = center.y - 100; - - this._nodeGrid = new cc.NodeGrid(); - this._nodeGrid.addChild(armature); - this.addChild(this._nodeGrid); - /* - * Set armature's frame event callback function - * To disconnect this event, just setFrameEventCallFunc(NULL, NULL); - */ - var self = this; - armature.getAnimation().setFrameEventCallFunc(function(bone, evt, originFrameIndex, currentFrameIndex) { - self.onFrameEvent(bone, evt, originFrameIndex, currentFrameIndex); - }); - - this.schedule(this.checkAction); - }, - title: function () { - return "Test Frame Event"; - }, - onFrameEvent: function (bone, evt, originFrameIndex, currentFrameIndex) { - cc.log("(" + bone.getName() + ") emit a frame event (" + evt + ") at frame index (" + currentFrameIndex + ")."); - if (cc._renderType === cc.game.RENDER_TYPE_CANVAS) { - return; - } - - if (!this.getActionByTag(FRAME_EVENT_ACTION_TAG) || this.getActionByTag(FRAME_EVENT_ACTION_TAG).isDone()) { - if ("opengl" in cc.sys.capabilities) { - this.stopAllActions(); - var action = cc.shatteredTiles3D(0.2, cc.size(16, 12), 5, false); - action.tag = FRAME_EVENT_ACTION_TAG; - this._nodeGrid.runAction(action); - } - } - }, - checkAction: function (dt) { - if ("opengl" in cc.sys.capabilities) { - if (this._nodeGrid.getNumberOfRunningActions() == 0 && this._nodeGrid.grid != null) - this._nodeGrid.grid = null; - } - } -}); - -//------------------------------------------------------------------ -// -// TestParticleDisplay -// -//------------------------------------------------------------------ -var TestParticleDisplay = ArmatureTestLayer.extend({ - animationID:0, - armature:null, - ctor:function(){ - this._super(); - - cc.eventManager.addListener({ - event: cc.EventListener.TOUCH_ALL_AT_ONCE, - onTouchesEnded: function (touches, event) { - var target = event.getCurrentTarget(); - ++target.animationID; - target.animationID = target.animationID % target.armature.getAnimation().getMovementCount(); - target.armature.getAnimation().playWithIndex(target.animationID,10); - return false; - } - }, this); - }, - onEnter:function () { - this._super(); - - this.animationID = 0; - - ccs.armatureDataManager.addArmatureFileInfo(s_robot_png, s_robot_plist, s_robot_xml); - this.armature = new ccs.Armature("robot"); - this.armature.getAnimation().playWithIndex(4); - var center = cc.visibleRect.center; - this.armature.x = center.x; - this.armature.y = center.y; - this.armature.scale = 0.48; - this.armature.getAnimation().setSpeedScale(0.5); - this.addChild(this.armature); - - var p1 = new cc.ParticleSystem("Particles/SmallSun.plist"); - p1.setTotalParticles(30); - var p2 = new cc.ParticleSystem("Particles/SmallSun.plist"); - p2.setTotalParticles(30); - var bone = new ccs.Bone("p1"); - bone.addDisplay(p1, 0); - bone.changeDisplayWithIndex(0, true); - bone.setIgnoreMovementBoneData(true); - bone.zIndex = 100; - bone.scale = 1.2; - this.armature.addBone(bone, "bady-a3"); - - bone = new ccs.Bone("p2"); - bone.addDisplay(p2, 0); - bone.changeDisplayWithIndex(0, true); - bone.setIgnoreMovementBoneData(true); - bone.zIndex = 100; - bone.scale = 1.2; - this.armature.addBone(bone, "bady-a30"); - }, - title:function () { - return "Test Particle Display"; - }, - subtitle:function () { - return "Touch to change animation"; - } -}); - -//------------------------------------------------------------------ -// -// TestUseMutiplePicture -// -//------------------------------------------------------------------ -var TestUseMutiplePicture = ArmatureTestLayer.extend({ - displayIndex:0, - armature:null, - ctor:function(){ - this._super(); - cc.eventManager.addListener({ - event: cc.EventListener.TOUCH_ALL_AT_ONCE, - onTouchesEnded: this.onTouchesEnded.bind(this) - }, this); - }, - onEnter:function () { - this._super(); - this.displayIndex = 0; - var armatureDataManager = ccs.armatureDataManager; - armatureDataManager.addArmatureFileInfo(s_knight_png, s_knight_plist, s_knight_xml); - armatureDataManager.addArmatureFileInfo(s_weapon_png, s_weapon_plist, s_weapon_xml); - - this.armature = new ccs.Armature("Knight_f/Knight"); - this.armature.getAnimation().playWithIndex(0); - this.armature.x = winSize.width / 2; - this.armature.y = winSize.height / 2; - this.armature.scale = 1.2; - this.addChild(this.armature); - - var weapon = ["weapon_f-sword.png", "weapon_f-sword2.png", "weapon_f-sword3.png", "weapon_f-sword4.png", "weapon_f-sword5.png", "weapon_f-knife.png", "weapon_f-hammer.png"]; - - //add skin - for (var i = 0; i < 7; i++) { - var skin = ccs.Skin.createWithSpriteFrameName(weapon[i]); - this.armature.getBone("weapon").addDisplay(skin, i); - } - - //add label - var label = new cc.LabelTTF("This is a weapon!", "Arial", 18); - label.anchorX = 0.2; - label.anchorY = 0.5; - this.armature.getBone("weapon").addDisplay(label, 7); - }, - title:function () { - return "Test One CCArmature Use Different Picture"; - }, - subtitle:function () { - return "Tap Screen"; - }, - onTouchesEnded:function (touch, event) { - ++this.displayIndex; - this.displayIndex = (this.displayIndex) % 8; - this.armature.getBone("weapon").changeDisplayWithIndex(this.displayIndex, true); - return false; - } -}); - -//------------------------------------------------------------------ -// -// TestColliderDetector -// -//------------------------------------------------------------------ -var TestColliderDetector = ArmatureTestLayer.extend({ - armature1:null, - armature2:null, - bullet:null, - space:null, - enemyTag: 1, - bulletTag: 2, - - onEnter:function () { - this._super(); - ccs.ENABLE_PHYSICS_CHIPMUNK_DETECT = true; - ccs.armatureDataManager.addArmatureFileInfo(s_Cowboy_json); - - this.armature1 = new ccs.Armature("Cowboy"); - this.armature1.getAnimation().play("FireWithoutBullet"); - this.armature1.getAnimation().setSpeedScale(0.2); - this.armature1.scaleX = -0.2; - this.armature1.scaleY = 0.2; - this.armature1.x = 170; - this.armature1.y = winSize.height / 2; - - /* - * Set armature's frame event callback function - * To disconnect this event, just setFrameEventCallFunc(nul, null); - */ - this.armature1.getAnimation().setFrameEventCallFunc(this.onFrameEvent,this); - - this.addChild(this.armature1); - - this.armature2 = new ccs.Armature("Cowboy"); - this.armature2.getAnimation().play("Walk"); - this.armature2.scaleX = -0.2; - this.armature2.scaleY = 0.2; - this.armature2.x = winSize.width - 160; - this.armature2.y = winSize.height / 2; - this.addChild(this.armature2); - - this.bullet = new cc.PhysicsSprite("#25.png"); - this.addChild(this.bullet); - - this.initWorld(); - this.scheduleUpdate(); - }, - initWorld:function(){ - this.space = new cp.Space(); - this.space.gravity = cp.v(0, 0); - - // Physics debug layer - var debugLayer = new cc.PhysicsDebugNode(this.space); - this.addChild(debugLayer, 9999); - - //init bullet body - var width = this.bullet.width, height = this.bullet.height; - var verts = [ - -width/2,-height/2, - -width/2,height/2, - width/2,height/2, - width/2,-height/2 - ]; - var body = new cp.Body(1, cp.momentForPoly(1,verts, cp.vzero)); - this.space.addBody(body); - var shape = new cp.PolyShape(body,verts, cp.vzero); - shape.collision_type = this.bulletTag; - this.space.addShape(shape); - this.bullet.setBody(body); - this.bullet.x = -100; - this.bullet.y = -100; - - //init armature body - body = new cp.Body(Infinity, Infinity); - this.space.addBody(body); - this.armature2.setBody(body); - var filter = new ccs.ColliderFilter(this.enemyTag); - this.armature2.setColliderFilter(filter); - //init collision handler - this.space.addCollisionHandler(this.enemyTag, this.bulletTag, this.beginHit.bind(this), null, null, this.endHit.bind(this)); - }, - onFrameEvent: function (bone, evt, originFrameIndex, currentFrameIndex) { - cc.log("(" + bone.getName() + ") emit a frame event (" + evt + ") at frame index (" + currentFrameIndex + ")."); - /* - * originFrameIndex is the frame index editted in Action Editor - * currentFrameIndex is the current index animation played to - * frame event may be delay emit, so originFrameIndex may be different from currentFrameIndex. - */ - var p = this.armature1.getBone("Layer126").getDisplayRenderNode().convertToWorldSpaceAR(cc.p(0, 0)); - this.bullet.x = p.x + 60; - this.bullet.y = p.y; - this.bullet.stopAllActions(); - this.bullet.runAction(cc.moveBy(1.5, cc.p(800, 0))); - }, - beginHit:function(arbiter, space){ - var shapes = arbiter.getShapes(); - var shapeA = shapes[0]; - var shapeB = shapes[1]; - var bone; - if(shapeA.collision_type==this.enemyTag) - bone = shapeA.data; - if(shapeB.collision_type==this.enemyTag) - bone = shapeB.data; - if(bone) - bone.getArmature().visible = false; - }, - - endHit:function(arbiter, space){ - var shapes = arbiter.getShapes(); - var shapeA = shapes[0]; - var shapeB = shapes[1]; - var bone; - if(shapeA.collision_type==this.enemyTag) - bone = shapeA.data; - if(shapeB.collision_type==this.enemyTag) - bone = shapeB.data; - if(bone) - bone.getArmature().visible = true; - }, - update:function(dt){ - this.space.step(dt); - }, - title:function () { - return "Test Collider Detector"; - }, - onExit:function(){ - this._super(); - var shapeList = this.armature2.getShapeList(); - for(var i = 0 ;i maxx ? vertex.x : maxx; - maxy = vertex.y > maxy ? vertex.y : maxy; - } - } - var temp = cc.rect(minx, miny, maxx - minx, maxy - miny); - - if (cc.rectContainsRect(temp, rect)) { - this.armature2.visible = false; - } - } - } - }, - draw: function () { - this.armature2.drawContour(); - }, - title: function () { - return "Test calculated vertex"; - }, - onExit:function(){ - this._super(); - ccs.ENABLE_PHYSICS_SAVE_CALCULATED_VERTEX = false; - } -}); - -//------------------------------------------------------------------ -// -// TestBoundingBox -// -//------------------------------------------------------------------ -var TestBoundingBox = ArmatureTestLayer.extend({ - armature: null, - drawNode: null, - onEnter:function () { - var _this = this; - _this._super(); - - _this.drawNode = new cc.DrawNode(); - _this.drawNode.setDrawColor(cc.color(100,100,100,255)); - _this.addChild(_this.drawNode); - - ccs.armatureDataManager.addArmatureFileInfo(s_Cowboy_json); - - _this.armature = new ccs.Armature("Cowboy"); - _this.armature.getAnimation().playWithIndex(0); - _this.armature.x = winSize.width / 2; - _this.armature.y = winSize.height / 2; - _this.armature.scale = 0.2; - _this.addChild(_this.armature); - - _this.scheduleUpdate(); - }, - - title:function () { - return "Test BoundingBox"; - }, - update: function () { - var rect = this.armature.getBoundingBox(); - this.drawNode.clear(); - this.drawNode.drawRect(cc.p(rect.x, rect.y), cc.p(cc.rectGetMaxX(rect), cc.rectGetMaxY(rect))); - } -}); - -//------------------------------------------------------------------ -// -// TestAnchorPoint -// -//------------------------------------------------------------------ -var TestAnchorPoint = ArmatureTestLayer.extend({ - onEnter:function () { - this._super(); - ccs.armatureDataManager.addArmatureFileInfo(s_Cowboy_json); - for (var i = 0; i < 5; i++) { - var armature = new ccs.Armature("Cowboy"); - armature.getAnimation().playWithIndex(0); - armature.x = winSize.width / 2; - armature.y = winSize.height / 2; - armature.scale = 0.2; - this.addChild(armature, 0, i); - } - - this.getChildByTag(0).anchorX = 0; - this.getChildByTag(0).anchorY = 0; - this.getChildByTag(1).anchorX = 0; - this.getChildByTag(1).anchorY = 1; - this.getChildByTag(2).anchorX = 1; - this.getChildByTag(2).anchorY = 0; - this.getChildByTag(3).anchorX = 1; - this.getChildByTag(3).anchorY = 1; - this.getChildByTag(4).anchorX = 0.5; - this.getChildByTag(4).anchorY = 0.5; - }, - title:function () { - return "Test Set AnchorPoint"; - } -}); - -//------------------------------------------------------------------ -// -// TestArmatureNesting -// -//------------------------------------------------------------------ -var TestArmatureNesting = ArmatureTestLayer.extend({ - armature:null, - weaponIndex:0, - ctor:function(){ - this._super(); - cc.eventManager.addListener({ - event: cc.EventListener.TOUCH_ALL_AT_ONCE, - onTouchesEnded: this.onTouchesEnded.bind(this) - }, this); - }, - onEnter:function () { - this._super(); - ccs.armatureDataManager.addArmatureFileInfo(s_cyborg_png, s_cyborg_plist, s_cyborg_xml); - this.armature = new ccs.Armature("cyborg"); - this.armature.getAnimation().playWithIndex(1); - this.armature.x = winSize.width / 2; - this.armature.y = winSize.height / 2; - this.armature.scale = 1.2; - this.armature.getAnimation().setSpeedScale(0.4); - this.addChild(this.armature); - this.weaponIndex = 0; - }, - title:function () { - return "Test CCArmature Nesting"; - }, - onTouchesEnded:function (touch, event) { - ++this.weaponIndex; - this.weaponIndex = this.weaponIndex % 4; - this.armature.getBone("armInside").getChildArmature().getAnimation().playWithIndex(this.weaponIndex); - this.armature.getBone("armOutside").getChildArmature().getAnimation().playWithIndex(this.weaponIndex); - } -}); - -//------------------------------------------------------------------ -// -// TestArmatureNesting2 -// -//------------------------------------------------------------------ -var Hero = ccs.Armature.extend({ - _mount: null, - _layer: null, - ctor: function () { - this._super(); - this._mount = null; - this._layer = null; - }, - - changeMount: function (armature) { - if (armature == null) { - this.retain(); - - this.playWithIndex(0); - //Remove hero from display list - this._mount.getBone("hero").removeDisplay(0); - this._mount.stopAllActions(); - - //Set position to current position - this.x = this._mount.x; - this.y = this._mount.y; - //Add to layer - this._layer.addChild(this); - this._mount = armature; - } - else { - this._mount = armature; - this.retain(); - //Remove from layer - this.removeFromParent(false); - - //Get the hero bone - var bone = armature.getBone("hero"); - //Add hero as a display to this bone - bone.addDisplay(this, 0); - //Change this bone's display - bone.changeDisplayWithIndex(0, true); - bone.setIgnoreMovementBoneData(true); - - this.x = 0; - - this.y = 0; - //Change animation - this.playWithIndex(1); - this.scale = 1; - } - - }, - - playWithIndex: function (index) { - this.getAnimation().playWithIndex(index); - if (this._mount) { - this._mount.getAnimation().playWithIndex(index); - } - }, - setLayer:function(layer){ - this._layer = layer; - }, - getLayer:function(){ - return this._layer; - }, - setMount:function(mount){ - this._mount = mount; - }, - getMount:function(){ - return this._mount; - } -}); - - -Hero.create = function(name){ - var hero = new Hero(); - if (hero && hero.init(name)) { - return hero; - } - return null; -}; - -var TestArmatureNesting2 = ArmatureTestLayer.extend({ - _hero: null, - _horse: null, - _horse2: null, - _bear: null, - _touchedMenu: false, - ctor:function(){ - this._super(); - cc.eventManager.addListener({ - event: cc.EventListener.TOUCH_ALL_AT_ONCE, - onTouchesEnded: this.onTouchesEnded.bind(this) - }, this); - }, - onEnter: function () { - this._super(); - - this._touchedMenu = false; - var label = new cc.LabelTTF("Change Mount", "Arial", 20); - var menuItem = new cc.MenuItemLabel(label, this.changeMountCallback, this); - var menu = new cc.Menu(menuItem); - menu.x = 0; - menu.y = 0; - menuItem.x = cc.visibleRect.right.x - 67; - menuItem.y = cc.visibleRect.bottom.y + 50; - this.addChild(menu, 2); - - //Create a hero - var hero = Hero.create("hero"); - hero.setLayer(this); - hero.playWithIndex(0); - hero.x = cc.visibleRect.left.x + 20; - hero.y = cc.visibleRect.left.y; - this.addChild(hero); - this._hero = hero; - - //Create 3 mount - this._horse = this.createMount("horse", cc.visibleRect.center); - this._horse2 = this.createMount("horse", cc.p(120, 200)); - this._horse2.opacity = 200; - this._bear = this.createMount("bear", cc.p(300, 70)); - }, - title: function () { - return "Test CCArmature Nesting 2"; - }, - subtitle: function () { - return "Move to a mount and press the ChangeMount Button."; - }, - onTouchesEnded: function (touches, event) { - var point = touches[0].getLocation(); - var armature = this._hero.getMount() == null ? this._hero : this._hero.getMount(); - //Set armature direction - if (point.x < armature.x) { - armature.scaleX = -1; - } - else { - armature.scaleX = 1; - } - - var move = cc.moveTo(2, point); - armature.stopAllActions(); - armature.runAction(move); - return false; - }, - - changeMountCallback: function (sender) { - this._hero.stopAllActions(); - if (this._hero.getMount()) { - this._hero.changeMount(null); - } - else { - var heroPos = cc.p(this._hero.x, this._hero.y); - var horsePos = cc.p(this._horse.x, this._horse.y); - var horse2Pos = cc.p(this._horse2.x, this._horse2.y); - var bearPos = cc.p(this._bear.x, this._bear.y); - - if (cc.pDistance(heroPos, horsePos) < 20) { - this._hero.changeMount(this._horse); - } - else if (cc.pDistance(heroPos, horse2Pos) < 20) { - this._hero.changeMount(this._horse2); - } - else if (cc.pDistance(heroPos, bearPos) < 30) { - this._hero.changeMount(this._bear); - } - } - }, - createMount: function (name, position) { - var armature = new ccs.Armature(name); - armature.getAnimation().playWithIndex(0); - armature.x = position.x; - armature.y = position.y; - this.addChild(armature); - return armature; - } -}); - -//------------------------------------------------------------------ -// -// TestPlaySeveralMovement -// -//------------------------------------------------------------------ -var TestPlaySeveralMovement = ArmatureTestLayer.extend({ - onEnter:function () { - this._super(); - ccs.armatureDataManager.addArmatureFileInfo(s_Cowboy_json); - var armature = new ccs.Armature("Cowboy"); - armature.getAnimation().playWithNames(["Walk", "FireMax", "Fire"],10,true); - armature.scale = 0.2; - armature.x = winSize.width / 2; - armature.y = winSize.height / 2; - this.addChild(armature); - }, - title:function () { - return "Test play several movement"; - }, - subtitle:function () { - return "Movement is played one by one"; - } -}); - -//------------------------------------------------------------------ -// -// TestChangeAnimationInternal -// -//------------------------------------------------------------------ -var TestChangeAnimationInternal = ArmatureTestLayer.extend({ - ctor:function(){ - this._super(); - cc.eventManager.addListener({ - event: cc.EventListener.TOUCH_ALL_AT_ONCE, - onTouchesEnded: this.onTouchesEnded.bind(this) - }, this); - }, - onEnter:function () { - this._super(); - - ccs.armatureDataManager.addArmatureFileInfo(s_Cowboy_json); - var armature = new ccs.Armature("Cowboy"); - armature.getAnimation().playWithIndex(0); - armature.scale = 0.2; - armature.x = winSize.width / 2; - armature.y = winSize.height / 2; - this.addChild(armature); - }, - title:function () { - return "Test change animation internal"; - }, - subtitle:function () { - return "Touch to change animation internal"; - }, - onTouchesEnded: function (touch, event) { - if (cc.director.getAnimationInterval() >= 1 / 40) { - cc.director.setAnimationInterval(1 / 60); - cc.log("Change to 60 fps"); - } - else { - cc.director.setAnimationInterval(1 / 30); - cc.log("Change to 30 fps"); - } - return false; - }, - onExit: function () { - this._super(); - cc.director.setAnimationInterval(1 / 60); - } -}); - -//------------------------------------------------------------------ -// -// TestChangeAnimationInternal -// -//------------------------------------------------------------------ -var TestEasing = ArmatureTestLayer.extend({ - animationID: 0, - armature: null, - ctor:function(){ - this._super(); - cc.eventManager.addListener({ - event: cc.EventListener.TOUCH_ALL_AT_ONCE, - onTouchesEnded: this.onTouchesEnded.bind(this) - }, this); - }, - onEnter: function () { - this._super(); - - ccs.armatureDataManager.addArmatureFileInfo(s_testEasing_json); - var armature = new ccs.Armature("testEasing"); - armature.getAnimation().playWithIndex(0); - armature.scale = 0.8; - armature.x = winSize.width / 2; - armature.y = winSize.height / 2; - this.addChild(armature); - this.armature = armature; - this.updateSubTitle(); - }, - title: function () { - return "Test easing effect"; - }, - subtitle: function () { - return "Current easing :"; - }, - onTouchesEnded: function (touch, event) { - this.animationID++; - this.animationID = this.animationID % this.armature.getAnimation().getMovementCount(); - this.armature.getAnimation().playWithIndex(this.animationID); - - this.updateSubTitle(); - return false; - }, - updateSubTitle: function () { - var str = this.subtitle() + this.armature.getAnimation().getCurrentMovementID(); - var label = this.getChildByTag(BASE_TEST_SUBTITLE_TAG); - label.setString(str); - } -}); - -var runArmatureTestScene = function(){ - var pScene = new ArmatureTestScene(); - if (pScene) { - pScene.runThisTest(); - } -}; \ No newline at end of file diff --git a/tests/js-tests/src/CocoStudioTest/CocoStudioTest.js b/tests/js-tests/src/CocoStudioTest/CocoStudioTest.js deleted file mode 100644 index 511f996813..0000000000 --- a/tests/js-tests/src/CocoStudioTest/CocoStudioTest.js +++ /dev/null @@ -1,152 +0,0 @@ -/**************************************************************************** - Copyright (c) 2008-2010 Ricardo Quesada - Copyright (c) 2011-2012 cocos2d-x.org - Copyright (c) 2013-2014 Chukong Technologies Inc. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -var LINE_SPACE = 40; -var ITEM_TAG_BASIC = 1000; - -var cocoStudioTestItemNames = [ - { - itemTitle:"CocoStudioArmatureTest", - testScene:function () { - runArmatureTestScene(); - } - }, - { - itemTitle:"CocoStudioGUITest", - testScene:function () { - runGuiTestMain(); - } - }, - { - itemTitle:"CocoStudioSceneTest", - testScene:function () { - runSceneEditorTest(); - } - }, - { - itemTitle:"ParserTest", - testScene:function(){ - runParserTest(); - } - }, - { - itemTitle:"ActionTimeLineTest", - testScene:function () { - runActionTimeLineTest(); - } - } -]; - -if(!cc.sys.isNative){ - cocoStudioTestItemNames.push({ - itemTitle: "CocoStudioComponentsTest", - testScene: function () { - runComponentsTestLayer(); - } - }); - cocoStudioTestItemNames.push({ - itemTitle:"CustomWidget", - testScene:function(){ - runCustomGUITest(); - } - }); -} - -cocoStudioTestItemNames.push({ - itemTitle:"CCSIssueTest", - testScene:function () { - runCCSIssueTest(); - } -}); - -var CocoStudioMainLayer = cc.Layer.extend({ - onEnter:function () { - this._super(); - - var winSize = cc.director.getWinSize(); - - var pMenu = new cc.Menu(); - pMenu.x = 0; - pMenu.y = 0; - cc.MenuItemFont.setFontName("Arial"); - cc.MenuItemFont.setFontSize(24); - for (var i = 0; i < cocoStudioTestItemNames.length; ++i) { - var selItem = cocoStudioTestItemNames[i]; - var pItem = new cc.MenuItemFont(selItem.itemTitle, - this.menuCallback, this); - pItem.x = winSize.width / 2; - pItem.y = winSize.height - (i + 1) * LINE_SPACE; - pMenu.addChild(pItem, ITEM_TAG_BASIC + i); - } - this.addChild(pMenu); - }, - - menuCallback:function (sender) { - var nIndex = sender.zIndex - ITEM_TAG_BASIC; - cocoStudioTestItemNames[nIndex].testScene(); - } -}); - -var cocoStudioOldApiFlag = 0; -var CocoStudioTestScene = TestScene.extend({ - - onEnter: function(){ - TestScene.prototype.onEnter.call(this); - - var winSize = cc.director.getWinSize(); - - var pMenu = new cc.Menu(); - pMenu.x = 0; - pMenu.y = 0; - cc.MenuItemFont.setFontName("Arial"); - cc.MenuItemFont.setFontSize(24); - var str = "new api"; - if(cocoStudioOldApiFlag){ - str = "old api"; - } - var pItem = new cc.MenuItemFont(str, - function(){ - if(cocoStudioOldApiFlag){ - cocoStudioOldApiFlag = 0; - pItem.setString("new api"); - }else{ - cocoStudioOldApiFlag = 1; - pItem.setString("old api"); - } - }, this); - pItem.x = 50; - pItem.y = winSize.height - 20; - pMenu.addChild(pItem); - - this.addChild(pMenu); - }, - - runThisTest:function () { - var pLayer = new CocoStudioMainLayer(); - this.addChild(pLayer); - cc.director.runScene(this); - } -}); diff --git a/tests/js-tests/src/CocoStudioTest/ComponentsTest/ComponentsTestScene.js b/tests/js-tests/src/CocoStudioTest/ComponentsTest/ComponentsTestScene.js deleted file mode 100644 index 3051d2b3b2..0000000000 --- a/tests/js-tests/src/CocoStudioTest/ComponentsTest/ComponentsTestScene.js +++ /dev/null @@ -1,77 +0,0 @@ -/**************************************************************************** - Copyright (c) 2008-2010 Ricardo Quesada - Copyright (c) 2011-2012 cocos2d-x.org - Copyright (c) 2013-2014 Chukong Technologies Inc. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -var ComponentsTestLayer = cc.LayerColor.extend({ - init: function () { - if (cc.LayerColor.prototype.init.call(this, cc.color(255, 255, 255, 255))) { - var root = this.createGameScene(); - this.addChild(root, 0, 1); - root.getChildByTag(1).addComponent(new ccs.ComAudio()); - root.getChildByTag(1).addComponent(PlayerController.create()); - root.addComponent(new ccs.ComAudio()); - root.addComponent(new ccs.ComAttribute()); - root.addComponent(SceneController.create()); - return true; - } - return false; - }, - - createGameScene: function () { - var root = new cc.Node(); - var winSize = cc.director.getWinSize(); - var player = new cc.Sprite("components/Player.png", cc.rect(0, 0, 27, 40)); - player.x = 30; - player.y = winSize.height / 2; - root.addChild(player, 1, 1); - - var itemBack = new cc.MenuItemFont("Back", this.toExtensionsMainLayer, this); - itemBack.color = cc.color(0, 0, 0); - itemBack.x = cc.visibleRect.bottomRight.x - 50; - itemBack.y = cc.visibleRect.bottomRight.y + 25; - var menuBack = new cc.Menu(itemBack); - menuBack.x = 0; - menuBack.y = 0; - this.addChild(menuBack); - return root; - }, - - toExtensionsMainLayer: function (sender) { - cc.audioEngine.stopMusic("background-music-aac.wav"); - var scene = new CocoStudioTestScene(); - scene.runThisTest(); - } -}); -ComponentsTestLayer.scene = function(){ - var scene = new cc.Scene(); - var layer = new ComponentsTestLayer(); - layer.init(); - scene.addChild(layer); - return scene; -}; -var runComponentsTestLayer = function () { - var scene = ComponentsTestLayer.scene(); - cc.director.runScene(scene); -}; \ No newline at end of file diff --git a/tests/js-tests/src/CocoStudioTest/ComponentsTest/EnemyController.js b/tests/js-tests/src/CocoStudioTest/ComponentsTest/EnemyController.js deleted file mode 100644 index fa186339af..0000000000 --- a/tests/js-tests/src/CocoStudioTest/ComponentsTest/EnemyController.js +++ /dev/null @@ -1,83 +0,0 @@ -/**************************************************************************** - Copyright (c) 2008-2010 Ricardo Quesada - Copyright (c) 2011-2012 cocos2d-x.org - Copyright (c) 2013-2014 Chukong Technologies Inc. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -var EnemyController = ccs.ComController.extend({ - ctor: function () { - this._super(); - this._name = "EnemyController"; - }, - init: function () { - return true; - }, - - onEnter: function () { - // Determine where to spawn the target along the Y axis - var winSize = cc.director.getWinSize(); - var minY = this.getOwner().height / 2; - var rangeY = winSize.height - this.getOwner().height; - var actualY = (Math.random() * rangeY ) + minY; - - // Create the target slightly off-screen along the right edge, - // and along a random position along the Y axis as calculated - this.getOwner().x = winSize.width + (this.getOwner().width / 2); - this.getOwner().y = actualY; - - - // Determine speed of the target - var minDuration = 2.0; - var maxDuration = 4.0; - var rangeDuration = maxDuration - minDuration; - var actualDuration = ( Math.random() % rangeDuration ) + minDuration; - - // Create the actions - var actionMove = cc.moveTo(actualDuration, cc.p(0 - this.getOwner().width / 2, actualY)); - var actionMoveDone = cc.callFunc(function () { - var comController = this.getOwner().parent.getComponent("SceneController"); - comController.spriteMoveFinished(this.getOwner()); - }, this); - this.getOwner().runAction(cc.sequence(actionMove, actionMoveDone)); - }, - - onExit: function () { - }, - - update: function (dt) { - - }, - - die: function () { - var com = this.getOwner().parent.getComponent("SceneController"); - var targets = com.getTargets(); - cc.arrayRemoveObject(targets, this.getOwner()); - this.getOwner().removeFromParent(true); - com.increaseKillCount(); - } -}); -EnemyController.create = function () { - var controller = new EnemyController(); - controller.init(); - return controller; -}; diff --git a/tests/js-tests/src/CocoStudioTest/ComponentsTest/GameOverScene.js b/tests/js-tests/src/CocoStudioTest/ComponentsTest/GameOverScene.js deleted file mode 100644 index 573bde95bb..0000000000 --- a/tests/js-tests/src/CocoStudioTest/ComponentsTest/GameOverScene.js +++ /dev/null @@ -1,74 +0,0 @@ -/**************************************************************************** - Copyright (c) 2008-2010 Ricardo Quesada - Copyright (c) 2011-2012 cocos2d-x.org - Copyright (c) 2013-2014 Chukong Technologies Inc. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -var GameOverLayer = cc.LayerColor.extend({ - _label: null, - init: function () { - if (this._super(cc.color(255, 255, 255, 255))) { - var winSize = cc.director.getWinSize(); - this._label = new cc.LabelTTF("", "Artial", 32); - this._label.retain(); - this._label.color = cc.color(0, 0, 0); - this._label.x = winSize.width / 2; - this._label.y = winSize.height / 2; - this.addChild(this._label); - this.runAction(cc.sequence(cc.delayTime(3), cc.callFunc(this.gameOverDone, this))); - var itemBack = new cc.MenuItemFont("Back", this.toExtensionsMainLayer, this); - itemBack.color = cc.color(0, 0, 0); - itemBack.x = cc.visibleRect.bottomRight.x - 50; - itemBack.y = cc.visibleRect.bottomRight.y + 25; - var menuBack = new cc.Menu(itemBack); - menuBack.x = 0; - menuBack.y = 0; - this.addChild(menuBack); - return true; - } - return false; - }, - gameOverDone: function () { - cc.director.runScene(ComponentsTestLayer.scene()); - }, - getLabel: function () { - return this._label; - } -}); -var GameOverScene = cc.Scene.extend({ - _layer: null, - init: function () { - this._super(); - this._layer = new GameOverLayer(); - this._layer.init(); - this.addChild(this._layer); - }, - getLayer: function () { - return this._layer; - } -}); -GameOverScene.create = function () { - var scene = new GameOverScene(); - scene.init(); - return scene; -}; diff --git a/tests/js-tests/src/CocoStudioTest/ComponentsTest/PlayerController.js b/tests/js-tests/src/CocoStudioTest/ComponentsTest/PlayerController.js deleted file mode 100644 index d49f7c1526..0000000000 --- a/tests/js-tests/src/CocoStudioTest/ComponentsTest/PlayerController.js +++ /dev/null @@ -1,66 +0,0 @@ -/**************************************************************************** - Copyright (c) 2008-2010 Ricardo Quesada - Copyright (c) 2011-2012 cocos2d-x.org - Copyright (c) 2013-2014 Chukong Technologies Inc. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -var PlayerController = ccs.ComController.extend({ - ctor: function () { - this._super(); - this._name = "PlayerController"; - - this._listener1 = cc.EventListener.create({ - event: cc.EventListener.TOUCH_ALL_AT_ONCE, - onTouchesEnded: this.onTouchesEnded.bind(this) - }); - - cc.eventManager.addListener(this._listener1, 1); - }, - - update: function (dt) { - - }, - - onTouchesEnded: function (touch, event) { - var location = touch[0].getLocation(); - - var projectile = new cc.Sprite("components/Projectile.png", cc.rect(0, 0, 20, 20)); - this.getOwner().parent.addChild(projectile, 1, 4); - - var com = ProjectileController.create(); - projectile.addComponent(com); - com.move(location.x, location.y); - - this.getOwner().getComponent("Audio").playEffect("pew-pew-lei.wav"); - }, - onExit:function(){ - cc.eventManager.removeListener(this._listener1); - this._super(); - } -}); - -PlayerController.create = function () { - var controller = new PlayerController(); - controller.init(); - return controller; -}; \ No newline at end of file diff --git a/tests/js-tests/src/CocoStudioTest/ComponentsTest/ProjectileController.js b/tests/js-tests/src/CocoStudioTest/ComponentsTest/ProjectileController.js deleted file mode 100644 index a4813fc0ea..0000000000 --- a/tests/js-tests/src/CocoStudioTest/ComponentsTest/ProjectileController.js +++ /dev/null @@ -1,122 +0,0 @@ -/**************************************************************************** - Copyright (c) 2008-2010 Ricardo Quesada - Copyright (c) 2011-2012 cocos2d-x.org - Copyright (c) 2013-2014 Chukong Technologies Inc. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -var ProjectileController = ccs.ComController.extend({ - ctor: function () { - this._super(); - this._name = "ProjectileController"; - }, - init: function () { - return true; - }, - - onEnter: function () { - var winSize = cc.director.getWinSize(); - this.getOwner().x = 30; - this.getOwner().y = winSize.height / 2; - this.getOwner().tag = 3; - var com = this.getOwner().parent.getComponent("SceneController"); - com.getProjectiles().push(this.getOwner()); - }, - - onExit: function () { - }, - - update: function (dt) { - var com = this.getOwner().parent.getComponent("SceneController"); - var targets = com.getTargets(); - - var projectile = this.getOwner(); - var projectileRect = cc.rect(projectile.x - (projectile.width / 2), projectile.y - (projectile.height / 2), projectile.width, projectile.height); - - var targetsToDelete = []; - var target = null; - var targetSize = null; - for (var i = 0; i < targets.length; i++) { - target = targets[i]; - var targetRect = cc.rect(target.x - (target.width / 2), target.y - (target.height / 2), target.width, target.height); - if (cc.rectIntersectsRect(projectileRect, targetRect)) { - targetsToDelete.push(target); - } - } - - for (var i = 0; i < targetsToDelete.length; i++) { - var target = targetsToDelete[i]; - target.getComponent("EnemyController").die(); - } - - var isDied = targetsToDelete.length; - - if (isDied) { - this.die(); - } - }, - - move: function (x, y) { - var winSize = cc.director.getWinSize(); - - var offX = x - this.getOwner().x; - var offY = y - this.getOwner().y; - - if (offX <= 0) return; - - // Determine where we wish to shoot the projectile to - var realX = winSize.width + (this.getOwner().width / 2); - var ratio = offY / offX; - var realY = (realX * ratio) + this.getOwner().y; - var realDest = cc.p(realX, realY); - - // Determine the length of how far we're shooting - var offRealX = realX - this.getOwner().x; - var offRealY = realY - this.getOwner().y; - var length = Math.sqrt((offRealX * offRealX) + (offRealY * offRealY)); - var velocity = 480 / 1; // 480pixels/1sec - var realMoveDuration = length / velocity; - - // Move projectile to actual endpoint - this.getOwner().runAction(cc.sequence( - cc.moveTo(realMoveDuration, realDest), - cc.callFunc(function () { - var sceneController = this.getOwner().parent.getComponent("SceneController"); - sceneController.spriteMoveFinished(this.getOwner()); - }, this))); - - }, - - die: function () { - var com = this.getOwner().parent.getComponent("SceneController"); - var projectiles = com.getProjectiles(); - cc.arrayRemoveObject(projectiles, this.getOwner()); - this.getOwner().removeFromParent(true); - } - -}); - -ProjectileController.create = function () { - var controller = new ProjectileController(); - controller.init(); - return controller; -}; \ No newline at end of file diff --git a/tests/js-tests/src/CocoStudioTest/ComponentsTest/SceneController.js b/tests/js-tests/src/CocoStudioTest/ComponentsTest/SceneController.js deleted file mode 100644 index ea4a515ea1..0000000000 --- a/tests/js-tests/src/CocoStudioTest/ComponentsTest/SceneController.js +++ /dev/null @@ -1,107 +0,0 @@ -/**************************************************************************** - Copyright (c) 2008-2010 Ricardo Quesada - Copyright (c) 2011-2012 cocos2d-x.org - Copyright (c) 2013-2014 Chukong Technologies Inc. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -var SceneController = ccs.ComController.extend({ - _targets: null, - _projectiles: null, - _addTargetTime: 0, - _elapsedTime: 0, - ctor: function () { - this._super(); - this._name = "SceneController"; - this._targets = []; - this._projectiles = []; - }, - init: function () { - return true; - }, - - onEnter: function () { - this._addTargetTime = 1; - this._targets = []; - this._projectiles = []; - this.getOwner().getComponent("Audio").playBackgroundMusic("background-music-aac.wav", true); - this.getOwner().getComponent("CCComAttribute").setInt("KillCount", 0); - }, - - onExit: function () { - - }, - - update: function (dt) { - this._elapsedTime += dt; - if (this._elapsedTime > this._addTargetTime) { - this.addTarget(); - this._elapsedTime = 0.0; - } - }, - - addTarget: function () { - var target = new cc.Sprite("components/Target.png", cc.rect(0, 0, 27, 40)); - this.getOwner().addChild(target, 1, 2); - target.addComponent(EnemyController.create()); - target.tag = 2; - this._targets.push(target); - }, - - spriteMoveFinished: function (sender) { - var sprite = sender; - this.getOwner().removeChild(sprite, true); - if (sprite.tag == 2) { - cc.arrayRemoveObject(this._targets, sprite); - var gameOverScene = GameOverScene.create(); - gameOverScene.getLayer().getLabel().setString("You Lose!"); - cc.director.runScene(gameOverScene); - } - else if (sprite.tag == 3) { - cc.arrayRemoveObject(this._projectiles, sprite); - } - - }, - - increaseKillCount: function () { - var comAttribute = this.getOwner().getComponent("CCComAttribute"); - var projectilesDestroyed = comAttribute.getInt("KillCount"); - comAttribute.setInt("KillCount", ++projectilesDestroyed); - if (projectilesDestroyed >= 5) { - var gameOverScene = GameOverScene.create(); - gameOverScene.getLayer().getLabel().setString("You Win!"); - cc.director.runScene(gameOverScene); - } - }, - getProjectiles: function () { - return this._projectiles; - }, - getTargets: function () { - return this._targets; - } -}); - -SceneController.create = function () { - var controller = new SceneController(); - controller.init(); - return controller; -}; \ No newline at end of file diff --git a/tests/js-tests/src/CocoStudioTest/CustomTest/CustomGUIScene.js b/tests/js-tests/src/CocoStudioTest/CustomTest/CustomGUIScene.js deleted file mode 100644 index 5b8ea55864..0000000000 --- a/tests/js-tests/src/CocoStudioTest/CustomTest/CustomGUIScene.js +++ /dev/null @@ -1,107 +0,0 @@ -/**************************************************************************** - Copyright (c) 2013-2014 Chukong Technologies Inc. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -var g_guisTests = [ - { - title: "custom gui image Test", - test: function(){ - var pScene = new CustomImageScene(); - pScene.runThisTest(); - } - },{ - title: "custom gui particle widget Test", - test: function(){ - var pScene = new CustomParticleWidgetScene(); - pScene.runThisTest(); - } - } -]; - -var CustomGUITestMainLayer = cc.Layer.extend({ - onEnter: function(){ - cc.Layer.prototype.onEnter.call(this); - - var winSize = cc.director.getWinSize(); - - var pMenu = new cc.Menu(); - pMenu.x = 0; - pMenu.y = 0; - cc.MenuItemFont.setFontName("fonts/arial.ttf"); - cc.MenuItemFont.setFontSize(24); - - for (var i = 0; i < g_guisTests.length; ++i) { - var selItem = g_guisTests[i]; - var pItem = new cc.MenuItemFont(selItem.title, - selItem.test, this); - pItem.x = winSize.width / 2; - pItem.y = winSize.height - (i + 1) * LINE_SPACE; - pMenu.addChild(pItem, ITEM_TAG_BASIC + i); - } - this.addChild(pMenu); - - }, - onTouchesBegan: function(touches, event){ - var touch = touches[0]; - - this._beginPos = touch.getLocation(); - }, - touchEvent: function(){ - - } - -}); - -var CustomGUITestScene = cc.Scene.extend({ - onEnter: function(){ - cc.Scene.prototype.onEnter.call(this); - - var label = new cc.LabelTTF("Back", "fonts/arial.ttf", 20); - //#endif - var pMenuItem = new cc.MenuItemLabel(label, this.BackCallback, this); - - var pMenu = new cc.Menu(pMenuItem); - - pMenu.setPosition( cc.p(0, 0) ); - pMenuItem.setPosition(cc.pAdd(cc.visibleRect.bottomRight,cc.p(-50,25))); - - this.addChild(pMenu, 1); - - }, - runThisTest: function(){ - var pLayer = new CustomGUITestMainLayer(); - this.addChild(pLayer); - - cc.director.runScene(this); - }, - BackCallback: function(pSender){ - var pScene = new CocoStudioTestScene(); - pScene.runThisTest(); - - } -}); - -var runCustomGUITest = function(){ - var scene = new CustomGUITestScene(); - scene.runThisTest(); -}; \ No newline at end of file diff --git a/tests/js-tests/src/CocoStudioTest/CustomTest/CustomImageScene/CustomImageScene.js b/tests/js-tests/src/CocoStudioTest/CustomTest/CustomImageScene/CustomImageScene.js deleted file mode 100644 index 90d087d69a..0000000000 --- a/tests/js-tests/src/CocoStudioTest/CustomTest/CustomImageScene/CustomImageScene.js +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** - Copyright (c) 2013-2014 Chukong Technologies Inc. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -var CustomImageLayer = cc.Layer.extend({ - - onEnter: function(){ - cc.Layer.prototype.onEnter.call(this); - - var guiReader = ccs.uiReader; - guiReader.registerTypeAndCallBack("CustomImageView", - CustomImageView, - customImageViewReader, - customImageViewReader.setProperties); - - var layout = guiReader.widgetFromJsonFile("ccs-res/cocosui/CustomImageViewTest/NewProject_2_1.ExportJson"); - this.addChild(layout); - } -}); - -var CustomImageScene = cc.Scene.extend({ - - onEnter: function(){ - cc.Scene.prototype.onEnter.call(this); - - var label = new cc.LabelTTF("Back", "fonts/arial.ttf", 20); - //#endif - var pMenuItem = new cc.MenuItemLabel(label, this.BackCallback, this); - - var pMenu = new cc.Menu(pMenuItem); - - pMenu.setPosition( cc.p(0, 0) ); - pMenuItem.setPosition( cc.p( 750, 25) ); - - this.addChild(pMenu, 1); - }, - runThisTest: function(){ - var pLayer = new CustomImageLayer(); - this.addChild(pLayer); - - cc.director.runScene(this); - }, - BackCallback: function(pSender){ - var pScene = new CustomGUITestScene(); - pScene.runThisTest(); - } -}); \ No newline at end of file diff --git a/tests/js-tests/src/CocoStudioTest/CustomTest/CustomImageView/CustomImageView.js b/tests/js-tests/src/CocoStudioTest/CustomTest/CustomImageView/CustomImageView.js deleted file mode 100644 index ca09265f98..0000000000 --- a/tests/js-tests/src/CocoStudioTest/CustomTest/CustomImageView/CustomImageView.js +++ /dev/null @@ -1,66 +0,0 @@ -/**************************************************************************** - Copyright (c) 2013-2014 Chukong Technologies Inc. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -var CustomImageView = ccui.ImageView.extend({ - - _label: null, - - init: function(){ - if (ccui.ImageView.prototype.init.call(this)) - { - return true; - } - return false; - }, - - _initRenderer: function(){ - ccui.ImageView.prototype._initRenderer.call(this); - - this._label = new cc.LabelTTF(); - cc.ProtectedNode.prototype.addChild.call(this, this._label, this.getLocalZOrder() + 1, -1); - }, - - createInstance: function(){ - return CustomImageView; - }, - - setText: function(text){ - this._label.setString(text); - }, - - getText: function(){ - return this._label.getString(); - } -}); - -CustomImageView.create = function(){ - var custom = new CustomImageView(); - - if (custom && custom.init()) - { - return custom; - } - return null; - -}; \ No newline at end of file diff --git a/tests/js-tests/src/CocoStudioTest/CustomTest/CustomImageView/CustomImageViewReader.js b/tests/js-tests/src/CocoStudioTest/CustomTest/CustomImageView/CustomImageViewReader.js deleted file mode 100644 index b2aec77aee..0000000000 --- a/tests/js-tests/src/CocoStudioTest/CustomTest/CustomImageView/CustomImageViewReader.js +++ /dev/null @@ -1,42 +0,0 @@ -/**************************************************************************** - Copyright (c) 2013-2014 Chukong Technologies Inc. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -var customImageViewReader = { - - _instanceCustomImageViewReader: null, - - setProperties: function(classType, widget, customOptions){ - var custom = widget; - - var StringTest = customOptions["StringTest"]; - if (StringTest) { - custom.setText(StringTest); - } - - }, - - setPropsFromJsonDictionary: function(){ - ccs.imageViewReader.setPropsFromJsonDictionary.apply(this, arguments); - } -}; \ No newline at end of file diff --git a/tests/js-tests/src/CocoStudioTest/CustomTest/CustomImageView/CustomParticWidgetReader.js b/tests/js-tests/src/CocoStudioTest/CustomTest/CustomImageView/CustomParticWidgetReader.js deleted file mode 100644 index f947e2f5ec..0000000000 --- a/tests/js-tests/src/CocoStudioTest/CustomTest/CustomImageView/CustomParticWidgetReader.js +++ /dev/null @@ -1,43 +0,0 @@ -/**************************************************************************** - Copyright (c) 2013-2014 Chukong Technologies Inc. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -var customParticleWidgetReader = { - - setProperties: function(classType, widget, customOptions){ - var guiReader = ccs.uiReader; - - var custom = widget; - - var isExistPlistFile = customOptions["PlistFile"]; - if (isExistPlistFile) - { - var PlistFile = customOptions["PlistFile"]; - var PlistFilePath = guiReader.getFilePath(); - PlistFilePath += PlistFile; - custom.setParticlePlist(PlistFilePath); - - } - - } -}; \ No newline at end of file diff --git a/tests/js-tests/src/CocoStudioTest/CustomTest/CustomImageView/CustomParticleWidget.js b/tests/js-tests/src/CocoStudioTest/CustomTest/CustomImageView/CustomParticleWidget.js deleted file mode 100644 index e3d3901ea0..0000000000 --- a/tests/js-tests/src/CocoStudioTest/CustomTest/CustomImageView/CustomParticleWidget.js +++ /dev/null @@ -1,104 +0,0 @@ -/**************************************************************************** - Copyright (c) 2013-2014 Chukong Technologies Inc. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -var CustomParticleWidget = ccui.Widget.extend({ - - _emitter: null, - - _emitterPlist: null, - - _emitterPostion: null, - - init: function(){ - if (ccui.Widget.prototype.init.call(this)) - { - return true; - } - return false; - }, - - _initRenderer: function(){ - ccui.Widget.prototype._initRenderer.call(this); - }, - - removeAllChildren: function(){ - ccui.Widget.prototype.removeAllChildren.call(this); - }, - - createInstance: function(){ - return CustomParticleWidget.create(); - }, - setParticlePlist: function(plist){ - if (!this._emitter) - { - this._emitter = new cc.ParticleSystem(plist); - - } - else - { - this._emitter.removeFromParent(); - this._emitter = new cc.ParticleSystem(plist); - } - //Warning!!! don't forget to set the position - this.addProtectedChild(this._emitter , this.getLocalZOrder() + 1, -1); - this.setParticlePosition(cc.p(0, 0)); - - this._emitterPlist = plist; - - }, - getParticlePlist: function(){ - return this._emitterPlist; - }, - setParticlePosition: function(pos){ - this._emitter.setPosition(pos); - - this._emitterPostion = pos; - - }, - getParticlePosition: function(){ - return this._emitterPostion; - }, - playParticle: function(){ - if (this._emitter) - { - this._emitter.resetSystem(); - } - }, - stopParticle: function(){ - if (this._emitter) - { - this._emitter.stopSystem(); - } - } -}); - -CustomParticleWidget.create = function(){ - var custom = new CustomParticleWidget(); - - if (custom && custom.init()) - { - return custom; - } - return null; -}; \ No newline at end of file diff --git a/tests/js-tests/src/CocoStudioTest/CustomTest/CustomImageView/CustomReader.js b/tests/js-tests/src/CocoStudioTest/CustomTest/CustomImageView/CustomReader.js deleted file mode 100644 index 333fb4f90f..0000000000 --- a/tests/js-tests/src/CocoStudioTest/CustomTest/CustomImageView/CustomReader.js +++ /dev/null @@ -1,43 +0,0 @@ -/**************************************************************************** - Copyright (c) 2013-2014 Chukong Technologies Inc. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -ccui.customReader = { - - _instanceCustomReader: null, - - setProperties: function(classType, widget, customOptions){ - if (classType.compare("CustomImageView") == 0) - { - var customImageView = widget; - - var isExistText = customOptions["text"]; - if (isExistText) - { - var text = customOptions["text"]; - customImageView.setText(text); - } - } - - } -}; \ No newline at end of file diff --git a/tests/js-tests/src/CocoStudioTest/CustomTest/CustomParticleWidgetTest/CustomParticleWidgetTest.js b/tests/js-tests/src/CocoStudioTest/CustomTest/CustomParticleWidgetTest/CustomParticleWidgetTest.js deleted file mode 100644 index 3b150a183f..0000000000 --- a/tests/js-tests/src/CocoStudioTest/CustomTest/CustomParticleWidgetTest/CustomParticleWidgetTest.js +++ /dev/null @@ -1,74 +0,0 @@ -/**************************************************************************** - Copyright (c) 2013-2014 Chukong Technologies Inc. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -var CustomParticleWidgetLayer = cc.Layer.extend({ - - onEnter: function(){ - cc.Layer.prototype.onEnter.call(this); - - var guiReader = ccs.uiReader; - guiReader.registerTypeAndCallBack("CustomParticleWidget", - CustomParticleWidget, - customParticleWidgetReader, - customParticleWidgetReader.setProperties); - - var custom = CustomParticleWidget.create(); - custom.setPosition(cc.p(370, 210)); - custom.setParticlePlist("Particles/BoilingFoam.plist"); - - this.addChild(custom, 10, -1); - } -}); - - -var CustomParticleWidgetScene = cc.Scene.extend({ - - onEnter: function(){ - cc.Scene.prototype.onEnter.call(this); - - var label = new cc.LabelTTF("Back", "fonts/arial.ttf", 20); - //#endif - var pMenuItem = new cc.MenuItemLabel(label, this.BackCallback, this); - - var pMenu = new cc.Menu(pMenuItem); - - pMenu.setPosition( cc.p(0, 0) ); - pMenuItem.setPosition( cc.p( 750, 25) ); - - this.addChild(pMenu, 1); - - }, - - runThisTest: function(){ - var pLayer = new CustomParticleWidgetLayer(); - this.addChild(pLayer); - - cc.director.runScene(this); - }, - - BackCallback: function(pSender){ - var pScene = new CustomGUITestScene(); - pScene.runThisTest(); - } -}); \ No newline at end of file diff --git a/tests/js-tests/src/CocoStudioTest/GUITest/UIBaseLayer.js b/tests/js-tests/src/CocoStudioTest/GUITest/UIBaseLayer.js deleted file mode 100644 index 3937657cde..0000000000 --- a/tests/js-tests/src/CocoStudioTest/GUITest/UIBaseLayer.js +++ /dev/null @@ -1,70 +0,0 @@ -/**************************************************************************** - Copyright (c) 2008-2010 Ricardo Quesada - Copyright (c) 2011-2012 cocos2d-x.org - Copyright (c) 2013-2014 Chukong Technologies Inc. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -var UIBaseLayer = cc.Layer.extend({ - _mainNode:null, - _topDisplayText:null, - ctor: function () { - this._super(); - var winSize = cc.director.getWinSize(); - - //add main node - var mainNode = new cc.Node(); - var scale = winSize.height / 320; - mainNode.attr({anchorX: 0, anchorY: 0, scale: scale, x: (winSize.width - 480 * scale) / 2, y: (winSize.height - 320 * scale) / 2}); - this.addChild(mainNode); - - var topDisplayText = new ccui.Text(); - topDisplayText.attr({ - string: "", - font: "20px Arial", - x: 240, - y: 320-50 - }); - mainNode.addChild(topDisplayText,100); - - this._mainNode = mainNode; - this._topDisplayText = topDisplayText; - }, - - _parseUIFile: function(file){ - if(cocoStudioOldApiFlag == 0){ - cc.log("ccs.load : %s", file); - var json = ccs.load(file); - return json.node; - }else{ - //ccs.uiReader.widgetFromJsonFile only supports 1.x file. - cc.log("ccs.uiReader.widgetFromJsonFile : %s", file); - return ccs.uiReader.widgetFromJsonFile(file) - } - }, - - backEvent: function (sender, type) { - if (type == ccui.Widget.TOUCH_ENDED) { - runGuiTestMain(); - } - } -}); \ No newline at end of file diff --git a/tests/js-tests/src/CocoStudioTest/GUITest/UIButtonTest/UIButtonTest.js b/tests/js-tests/src/CocoStudioTest/GUITest/UIButtonTest/UIButtonTest.js deleted file mode 100644 index e782f88291..0000000000 --- a/tests/js-tests/src/CocoStudioTest/GUITest/UIButtonTest/UIButtonTest.js +++ /dev/null @@ -1,68 +0,0 @@ -/**************************************************************************** - Copyright (c) 2008-2010 Ricardo Quesada - Copyright (c) 2011-2012 cocos2d-x.org - Copyright (c) 2013-2014 Chukong Technologies Inc. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -var UIButtonEditorTest = UIBaseLayer.extend({ - ctor: function () { - this._super(); - var root = this._parseUIFile("ccs-res/cocosui/UIEditorTest/UIButton/Button_1.json"); - this._mainNode.addChild(root); - - var back_label = ccui.helper.seekWidgetByName(root, "back"); - back_label.addTouchEventListener(this.backEvent,this); - - var button = ccui.helper.seekWidgetByName(root, "Button_123"); - button.addTouchEventListener(this.touchEvent,this); - - var title_button = ccui.helper.seekWidgetByName(root, "Button_126"); - title_button.addTouchEventListener(this.touchEvent,this); - - var scale9_button = ccui.helper.seekWidgetByName(root, "Button_129"); - scale9_button.addTouchEventListener(this.touchEvent,this); - }, - - touchEvent: function (sender, type) { - switch (type) { - case ccui.Widget.TOUCH_BEGAN: - this._topDisplayText.setString("Touch Down"); - break; - - case ccui.Widget.TOUCH_MOVED: - this._topDisplayText.setString("Touch Move"); - break; - - case ccui.Widget.TOUCH_ENDED: - this._topDisplayText.setString("Touch Up"); - break; - - case ccui.Widget.TOUCH_CANCELED: - this._topDisplayText.setString("Touch Cancelled"); - break; - - default: - break; - } - } -}); diff --git a/tests/js-tests/src/CocoStudioTest/GUITest/UICheckBoxTest/UICheckBoxTest.js b/tests/js-tests/src/CocoStudioTest/GUITest/UICheckBoxTest/UICheckBoxTest.js deleted file mode 100644 index e9b09bd745..0000000000 --- a/tests/js-tests/src/CocoStudioTest/GUITest/UICheckBoxTest/UICheckBoxTest.js +++ /dev/null @@ -1,113 +0,0 @@ -/**************************************************************************** - Copyright (c) 2008-2010 Ricardo Quesada - Copyright (c) 2011-2012 cocos2d-x.org - Copyright (c) 2013-2014 Chukong Technologies Inc. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ -var CEHCK_BOX_INDEX = 0; - -var UICheckBoxEditorTest = UIBaseLayer.extend({ - ctor: function () { - this._super(); - var left_button = new ccui.Button(); - left_button.loadTextures("Images/b1.png", "Images/b2.png", ""); - left_button.x = 240-50; - left_button.y = 50; - left_button.anchorX = 0.5; - left_button.anchorY = 0.5; - left_button.addTouchEventListener(this.previousCallback, this); - this._mainNode.addChild(left_button, 999); - - var right_button = new ccui.Button(); - right_button.loadTextures("Images/f1.png", "Images/f2.png", ""); - right_button.x = 240+50; - right_button.y = 50; - right_button.anchorX = 0.5; - right_button.anchorY = 0.5; - right_button.addTouchEventListener(this.nextCallback, this); - this._mainNode.addChild(right_button, 999); - }, - previousCallback: function (render, type) { - if (type == ccui.Widget.TOUCH_ENDED) { - CEHCK_BOX_INDEX--; - if (CEHCK_BOX_INDEX < 0)CEHCK_BOX_INDEX = CEHCK_BOX_SCENE.length-1; - if (CEHCK_BOX_INDEX >= CEHCK_BOX_SCENE.length)CEHCK_BOX_INDEX = 0; - this.runNextScene(); - } - }, - nextCallback: function (render, type) { - if (type == ccui.Widget.TOUCH_ENDED) { - CEHCK_BOX_INDEX++; - if (CEHCK_BOX_INDEX < 0)CEHCK_BOX_INDEX = CEHCK_BOX_SCENE.length-1; - if (CEHCK_BOX_INDEX >= CEHCK_BOX_SCENE.length)CEHCK_BOX_INDEX = 0; - this.runNextScene(); - } - }, - runNextScene: function () { - var scene = new cc.Scene(); - scene.addChild(new CEHCK_BOX_SCENE[CEHCK_BOX_INDEX]()); - cc.director.runScene(scene); - }, - - selectedStateEvent: function (sender, type) { - switch (type) { - case ccui.CheckBox.EVENT_SELECTED: - this._topDisplayText.setString("Selected"); - break; - case ccui.CheckBox.EVENT_UNSELECTED: - this._topDisplayText.setString("Unselected"); - break; - - default: - break; - } - } -}); - -var UICheckBoxOldTest = UICheckBoxEditorTest.extend({ - ctor: function () { - this._super(); - var root = this._parseUIFile("ccs-res/cocosui/UIEditorTest/UICheckBox/checkbox_1.json"); - this._mainNode.addChild(root); - - var back_label =ccui.helper.seekWidgetByName(root, "back"); - back_label.addTouchEventListener(this.backEvent,this); - - var checkbox = ccui.helper.seekWidgetByName(root, "CheckBox_540"); - checkbox.addEventListener(this.selectedStateEvent,this); - } -}); - -var UICheckBoxNewTest = UICheckBoxEditorTest.extend({ - ctor: function () { - this._super(); - var root = ccs.load("ccs-res/cocosui/UIEditorTest/UICheckBox/MainScene.json"); - this._mainNode.addChild(root.node); - var checkbox = ccui.helper.seekWidgetByName(root.node, "CheckBox_1"); - checkbox.addEventListener(this.selectedStateEvent,this); - } -}); - -var CEHCK_BOX_SCENE = [ - UICheckBoxOldTest, - UICheckBoxNewTest -]; diff --git a/tests/js-tests/src/CocoStudioTest/GUITest/UIImageViewTest/UIImageViewTest.js b/tests/js-tests/src/CocoStudioTest/GUITest/UIImageViewTest/UIImageViewTest.js deleted file mode 100644 index 30a8b24e6a..0000000000 --- a/tests/js-tests/src/CocoStudioTest/GUITest/UIImageViewTest/UIImageViewTest.js +++ /dev/null @@ -1,36 +0,0 @@ -/**************************************************************************** - Copyright (c) 2008-2010 Ricardo Quesada - Copyright (c) 2011-2012 cocos2d-x.org - Copyright (c) 2013-2014 Chukong Technologies Inc. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -var UIImageViewEditorTest = UIBaseLayer.extend({ - ctor: function () { - this._super(); - var root = this._parseUIFile("ccs-res/cocosui/UIEditorTest/UIImageView/ImageView_1.json"); - this._mainNode.addChild(root); - - var back_label =ccui.helper.seekWidgetByName(root, "back"); - back_label.addTouchEventListener(this.backEvent,this); - } -}); diff --git a/tests/js-tests/src/CocoStudioTest/GUITest/UILayoutTest/UILayoutTest.js b/tests/js-tests/src/CocoStudioTest/GUITest/UILayoutTest/UILayoutTest.js deleted file mode 100644 index 399c64315c..0000000000 --- a/tests/js-tests/src/CocoStudioTest/GUITest/UILayoutTest/UILayoutTest.js +++ /dev/null @@ -1,88 +0,0 @@ -/**************************************************************************** - Copyright (c) 2008-2010 Ricardo Quesada - Copyright (c) 2011-2012 cocos2d-x.org - Copyright (c) 2013-2014 Chukong Technologies Inc. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ -var LAYOUT_RES = [ - "ccs-res/cocosui/UIEditorTest/UILayout/Layout/layout_1.json", - "ccs-res/cocosui/UIEditorTest/UILayout/Color/color_1.json", - "ccs-res/cocosui/UIEditorTest/UILayout/Gradient_Color/gradient_color_1.json", - "ccs-res/cocosui/UIEditorTest/UILayout/BackgroundImage/backgroundimage_1.json", - "ccs-res/cocosui/UIEditorTest/UILayout/Scale9_BackgroundImage/scale9.json", - "ccs-res/cocosui/UIEditorTest/UILayout/Linear_Vertical_Layout/linear_vertical.json", - "ccs-res/cocosui/UIEditorTest/UILayout/Linear_Horizontal_Layout/linear_horizontal.json", - "ccs-res/cocosui/UIEditorTest/UILayout/Relative_Align_Parent/relative_align_parent.json", - "ccs-res/cocosui/UIEditorTest/UILayout/Relative_Align_Location/relative_align_location.json" -]; -var LAYOUT_INDEX = 0; -var UILayoutEditorTest = UIBaseLayer.extend({ - ctor: function () { - this._super(); - var root = this._parseUIFile(LAYOUT_RES[LAYOUT_INDEX]); - this._mainNode.addChild(root); - - var back_label = ccui.helper.seekWidgetByName(root, "back"); - back_label.addTouchEventListener(this.backEvent, this); - - var left_button = new ccui.Button(); - left_button.loadTextures("Images/b1.png", "Images/b2.png", ""); - left_button.x = 240-50; - left_button.y = 50; - left_button.anchorX = 0.5; - left_button.anchorY = 0.5; - left_button.zOrder = 999; - left_button.addTouchEventListener(this.previousCallback, this); - this._mainNode.addChild(left_button); - - var right_button = new ccui.Button(); - right_button.loadTextures("Images/f1.png", "Images/f2.png", ""); - right_button.x = 240+50; - right_button.y = 50; - right_button.zOrder = 999; - right_button.anchorX = 0.5; - right_button.anchorY = 0.5; - right_button.addTouchEventListener(this.nextCallback, this); - this._mainNode.addChild(right_button); - }, - previousCallback: function (render, type) { - if (type == ccui.Widget.TOUCH_ENDED) { - LAYOUT_INDEX--; - if (LAYOUT_INDEX < 0)LAYOUT_INDEX = LAYOUT_RES.length-1; - if (LAYOUT_INDEX >= LAYOUT_RES.length)LAYOUT_INDEX = 0; - this.runNextScene(); - } - }, - nextCallback: function (render, type) { - if (type == ccui.Widget.TOUCH_ENDED) { - LAYOUT_INDEX++; - if (LAYOUT_INDEX < 0)LAYOUT_INDEX = LAYOUT_RES.length-1; - if (LAYOUT_INDEX >= LAYOUT_RES.length)LAYOUT_INDEX = 0; - this.runNextScene(); - } - }, - runNextScene: function () { - var scene = new cc.Scene(); - scene.addChild(new UILayoutEditorTest()); - cc.director.runScene(scene); - } -}); diff --git a/tests/js-tests/src/CocoStudioTest/GUITest/UIListViewTest/UIListViewTest.js b/tests/js-tests/src/CocoStudioTest/GUITest/UIListViewTest/UIListViewTest.js deleted file mode 100644 index 11aad78a66..0000000000 --- a/tests/js-tests/src/CocoStudioTest/GUITest/UIListViewTest/UIListViewTest.js +++ /dev/null @@ -1,97 +0,0 @@ -/**************************************************************************** - Copyright (c) 2008-2010 Ricardo Quesada - Copyright (c) 2011-2012 cocos2d-x.org - Copyright (c) 2013-2014 Chukong Technologies Inc. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ -var LISTVIEW_RES = [ - "ccs-res/cocosui/UIEditorTest/UIListView/Vertical/vertical_1.json", - "ccs-res/cocosui/UIEditorTest/UIListView/Horizontal/horizontal_1.json" -]; -var LISTVIEW_INDEX = 0; -var UIListViewEditorTest = UIBaseLayer.extend({ - ctor: function () { - this._super(); - var root = this._parseUIFile(LISTVIEW_RES[LISTVIEW_INDEX]); - this._mainNode.addChild(root); - - var back_label = ccui.helper.seekWidgetByName(root, "back"); - back_label.addTouchEventListener(this.backEvent, this); - - var listView = ccui.helper.seekWidgetByName(root, "ListView_1214"); - listView.addEventListener(this.selectedItemEvent,this); - - var left_button = new ccui.Button(); - left_button.loadTextures("Images/b1.png", "Images/b2.png", ""); - left_button.x = 240-50; - left_button.y = 50; - left_button.anchorX = 0.5; - left_button.anchorY = 0.5; - left_button.zOrder = 999; - left_button.addTouchEventListener(this.previousCallback, this); - this._mainNode.addChild(left_button); - - var right_button = new ccui.Button(); - right_button.loadTextures("Images/f1.png", "Images/f2.png", ""); - right_button.x = 240+50; - right_button.y = 50; - right_button.zOrder = 999; - right_button.anchorX = 0.5; - right_button.anchorY = 0.5; - right_button.addTouchEventListener(this.nextCallback, this); - this._mainNode.addChild(right_button); - }, - selectedItemEvent: function (sender, type) { - switch (type) { - case ccui.ListView.EVENT_SELECTED_ITEM: - var listViewEx = sender; - cc.log("select child index = " + listViewEx.getCurSelectedIndex()); - break; - - default: - break; - } - }, - previousCallback: function (render, type) { - if (type == ccui.Widget.TOUCH_ENDED) { - LISTVIEW_INDEX--; - if (LISTVIEW_INDEX < 0)LISTVIEW_INDEX = LISTVIEW_RES.length-1; - if (LISTVIEW_INDEX >= LISTVIEW_RES.length)LISTVIEW_INDEX = 0; - this.runNextScene(); - } - }, - nextCallback: function (render, type) { - if (type == ccui.Widget.TOUCH_ENDED) { - LISTVIEW_INDEX++; - if (LISTVIEW_INDEX < 0)LISTVIEW_INDEX = LISTVIEW_RES.length-1; - if (LISTVIEW_INDEX >= LISTVIEW_RES.length)LISTVIEW_INDEX = 0; - this.runNextScene(); - } - }, - runNextScene: function () { - var scene = new cc.Scene(); - scene.addChild(new UIListViewEditorTest()); - cc.director.runScene(scene); - } -}); - - diff --git a/tests/js-tests/src/CocoStudioTest/GUITest/UILoadingBarTest/UILoadingBarTest.js b/tests/js-tests/src/CocoStudioTest/GUITest/UILoadingBarTest/UILoadingBarTest.js deleted file mode 100644 index 6be9d13de9..0000000000 --- a/tests/js-tests/src/CocoStudioTest/GUITest/UILoadingBarTest/UILoadingBarTest.js +++ /dev/null @@ -1,55 +0,0 @@ -/**************************************************************************** - Copyright (c) 2008-2010 Ricardo Quesada - Copyright (c) 2011-2012 cocos2d-x.org - Copyright (c) 2013-2014 Chukong Technologies Inc. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -var UILoadingBarEditorTest = UIBaseLayer.extend({ - _count: 0, - _loadingBar_left_to_right:null, - _loadingBar_right_to_left:null, - ctor: function () { - this._super(); - var root = this._parseUIFile("ccs-res/cocosui/UIEditorTest/UILoadingBar/loadingbar_1.json"); - this._mainNode.addChild(root); - - var back_label =ccui.helper.seekWidgetByName(root, "back"); - back_label.addTouchEventListener(this.backEvent,this); - - this._loadingBar_left_to_right = ccui.helper.seekWidgetByName(root, "LoadingBar_856"); - this._loadingBar_left_to_right.setPercent(0); - - this._loadingBar_right_to_left = ccui.helper.seekWidgetByName(root, "LoadingBar_857"); - this._loadingBar_right_to_left.setPercent(0); - - this.scheduleUpdate(); - }, - update: function (dt) { - this._count++; - if (this._count > 100) { - this._count = 0; - } - this._loadingBar_left_to_right.setPercent(this._count); - this._loadingBar_right_to_left.setPercent(this._count); - } -}); diff --git a/tests/js-tests/src/CocoStudioTest/GUITest/UINodeContainerTest/UINodeContainerTest.js b/tests/js-tests/src/CocoStudioTest/GUITest/UINodeContainerTest/UINodeContainerTest.js deleted file mode 100644 index d03af69b74..0000000000 --- a/tests/js-tests/src/CocoStudioTest/GUITest/UINodeContainerTest/UINodeContainerTest.js +++ /dev/null @@ -1,41 +0,0 @@ -/**************************************************************************** - Copyright (c) 2008-2010 Ricardo Quesada - Copyright (c) 2011-2012 cocos2d-x.org - Copyright (c) 2013-2014 Chukong Technologies Inc. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -var UIWidgetAddNodeEditorTest = UIBaseLayer.extend({ - ctor: function () { - this._super(); - var root = this._parseUIFile("ccs-res/cocosui/UIEditorTest/UIWidgetAddNode/widget_add_node.json"); - this._mainNode.addChild(root); - - var back_label =ccui.helper.seekWidgetByName(root, "back"); - back_label.addTouchEventListener(this.backEvent,this); - - var sprite = new cc.Sprite("ccs-res/cocosui/ccicon.png"); - sprite.x = 240; - sprite.y = 160; - root.addNode(sprite,9999); - } -}); diff --git a/tests/js-tests/src/CocoStudioTest/GUITest/UIPageViewTest/UIPageViewTest.js b/tests/js-tests/src/CocoStudioTest/GUITest/UIPageViewTest/UIPageViewTest.js deleted file mode 100644 index 94c20a1838..0000000000 --- a/tests/js-tests/src/CocoStudioTest/GUITest/UIPageViewTest/UIPageViewTest.js +++ /dev/null @@ -1,50 +0,0 @@ -/**************************************************************************** - Copyright (c) 2008-2010 Ricardo Quesada - Copyright (c) 2011-2012 cocos2d-x.org - Copyright (c) 2013-2014 Chukong Technologies Inc. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -var UIPageViewEditorTest = UIBaseLayer.extend({ - ctor: function () { - this._super(); - var root = this._parseUIFile("ccs-res/cocosui/UIEditorTest/UIPageView/pageview_1.json"); - this._mainNode.addChild(root); - - var back_label =ccui.helper.seekWidgetByName(root, "back"); - back_label.addTouchEventListener(this.backEvent,this); - - var pageView =ccui.helper.seekWidgetByName(root, "PageView_1269"); - pageView.addEventListener(this.pageViewEvent, this); - }, - - pageViewEvent: function (sender, type) { - switch (type) { - case ccui.PageView.EVENT_TURNING: - var pageView = sender; - this._topDisplayText.setString("page = " + (pageView.getCurPageIndex() + 1)); - break; - default: - break; - } - } -}); diff --git a/tests/js-tests/src/CocoStudioTest/GUITest/UIRichTextTest/UIRichTextTest.js b/tests/js-tests/src/CocoStudioTest/GUITest/UIRichTextTest/UIRichTextTest.js deleted file mode 100644 index 6a1f9a0617..0000000000 --- a/tests/js-tests/src/CocoStudioTest/GUITest/UIRichTextTest/UIRichTextTest.js +++ /dev/null @@ -1,92 +0,0 @@ -/**************************************************************************** - Copyright (c) 2008-2010 Ricardo Quesada - Copyright (c) 2011-2012 cocos2d-x.org - Copyright (c) 2013-2014 Chukong Technologies Inc. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -var UIRichTextTest = UISceneEditor.extend({ - _richText:null, - init: function () { - if (this._super()) { - //init text - this._topDisplayLabel.setString(""); - this._bottomDisplayLabel.setString("RichText"); - - var widgetSize = this._widget.getContentSize(); - var button = new ccui.Button(); - button.setTouchEnabled(true); - button.loadTextures("ccs-res/cocosui/animationbuttonnormal.png", "ccs-res/cocosui/animationbuttonpressed.png", ""); - button.setTitleText("switch"); - button.setPosition(cc.p(widgetSize.width / 2, widgetSize.height / 2 + button.getContentSize().height * 2.5)); - button.addTouchEventListener(this.touchEvent,this); - this._mainNode.addChild(button); - - - // RichText - var richText = new ccui.RichText(); - richText.ignoreContentAdaptWithSize(false); - richText.setContentSize(cc.size(120, 100)); - - var re1 = new ccui.RichElementText(1, cc.color.WHITE, 255, "This color is white. ", "Helvetica", 10); - var re2 = new ccui.RichElementText(2, cc.color.YELLOW, 255, "And this is yellow. ", "Helvetica", 10); - var re3 = new ccui.RichElementText(3, cc.color.BLUE, 255, "This one is blue. ", "Helvetica", 10); - var re4 = new ccui.RichElementText(4, cc.color.GREEN, 255, "And green. ", "Helvetica", 10); - var re5 = new ccui.RichElementText(5, cc.color.RED, 255, "Last one is red ", "Helvetica", 10); - - var reimg = new ccui.RichElementImage(6, cc.color.WHITE, 255, "ccs-res/cocosui/sliderballnormal.png"); - - ccs.armatureDataManager.addArmatureFileInfo("ccs-res/cocosui/100/100.ExportJson"); - var pAr = new ccs.Armature("100"); - pAr.getAnimation().play("Animation1"); - - var recustom = new ccui.RichElementCustomNode(1, cc.color.WHITE, 255, pAr); - var re6 = new ccui.RichElementText(7, cc.color.ORANGE, 255, "Have fun!! ", "Helvetica", 10); - richText.pushBackElement(re1); - richText.insertElement(re2, 1); - richText.pushBackElement(re3); - richText.pushBackElement(re4); - richText.pushBackElement(re5); - richText.insertElement(reimg, 2); - richText.pushBackElement(recustom); - richText.pushBackElement(re6); - - richText.setPosition(cc.p(widgetSize.width / 2, widgetSize.height / 2)); - - this._mainNode.addChild(richText); - this._richText = richText; - return true; - } - return false; - }, - touchEvent: function (sender, type) { - if (type == ccui.Widget.TOUCH_ENDED) { - if (this._richText.isIgnoreContentAdaptWithSize()) { - this._richText.ignoreContentAdaptWithSize(false); - this._richText.setContentSize(cc.size(120, 100)); - } - else { - this._richText.ignoreContentAdaptWithSize(true); - } - } - } -}); \ No newline at end of file diff --git a/tests/js-tests/src/CocoStudioTest/GUITest/UISceneTest.js b/tests/js-tests/src/CocoStudioTest/GUITest/UISceneTest.js deleted file mode 100644 index d1e25af47e..0000000000 --- a/tests/js-tests/src/CocoStudioTest/GUITest/UISceneTest.js +++ /dev/null @@ -1,177 +0,0 @@ -/**************************************************************************** - Copyright (c) 2008-2010 Ricardo Quesada - Copyright (c) 2011-2012 cocos2d-x.org - Copyright (c) 2013-2014 Chukong Technologies Inc. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS()", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -var s_GuiTestEditorArray = [ - { - title: "Button", - layer: function () { - return new UIButtonEditorTest(); - } - }, - { - title: "CheckBox", - layer: function () { - return new CEHCK_BOX_SCENE[0](); - } - }, - { - title: "ImageView", - layer: function () { - return new UIImageViewEditorTest(); - } - }, - { - title: "Text", - layer: function () { - return new UITextEditorTest(); - } - }, - { - title: "TextAtlas", - layer: function () { - return new UITextAtlasEditorTest(); - } - }, - { - title: "TextBMFont", - layer: function () { - return new UITextBMFontEditorTest(); - } - }, - { - title: "LoadingBar", - layer: function () { - return new UILoadingBarEditorTest(); - } - }, - { - title: "Slider", - layer: function () { - return new UISliderEditorTest(); - } - }, - { - title: "TextField", - layer: function () { - return new UITextFieldEditorTest(); - } - }, - { - title: "AddNode", - layer: function () { - return new UIWidgetAddNodeEditorTest(); - } - }, - { - title: "Layout", - layer: function () { - return new UILayoutEditorTest(); - } - }, - { - title: "ListView", - layer: function () { - return new UIListViewEditorTest(); - } - }, - { - title: "PageView", - layer: function () { - return new UIPageViewEditorTest(); - } - }, - { - title: "ScrollView", - layer: function () { - return new UIScrollViewEditorTest(); - } - } -]; - -var GuiTestMainLayer = cc.Layer.extend({ - ctor: function () { - this._super(); - var winSize = cc.winSize; - var x = 0; - var y = winSize.height - 10; - for (var i = 0; i < s_GuiTestEditorArray.length; i++) { - var guiTest = s_GuiTestEditorArray[i]; - var text = new ccui.Text(); - if (i % 2 == 0) { - x = winSize.width / 2 - 100; - y -= 30; - } else { - x = winSize.width / 2 + 100; - } - text.attr({ - string: guiTest.title, - font: "20px Arial", - x: x, - y: y, - tag: i - }); - text.setTouchEnabled(true); - text.setTouchScaleChangeEnabled(true); - text.addTouchEventListener(this.touchEvent, this); - this.addChild(text); - } - - var backText = new ccui.Text(); - backText.attr({ - string: "Back", - font: "20px Arial", - x: winSize.width-50, - y: 50, - tag: 10000 - }); - backText.setTouchEnabled(true); - backText.setTouchScaleChangeEnabled(true); - backText.addTouchEventListener(this.backEvent, this); - this.addChild(backText); - }, - touchEvent:function(sender,type){ - if(type==ccui.Widget.TOUCH_ENDED){ - var tag = sender.tag; - var scene = new cc.Scene(); - var guiTest = s_GuiTestEditorArray[tag]; - scene.addChild(guiTest.layer()); - cc.director.runScene(scene); - } - }, - backEvent:function(sender,type){ - if(type==ccui.Widget.TOUCH_ENDED){ - var scene = new CocoStudioTestScene(); - scene.runThisTest(); - } - } -}); - -var runGuiTestMain = function(){ - var scene = new cc.Scene(); - var main = new GuiTestMainLayer(); - scene.addChild(main); - cc.director.runScene(scene); -} \ No newline at end of file diff --git a/tests/js-tests/src/CocoStudioTest/GUITest/UIScrollViewTest/UIScrollViewTest.js b/tests/js-tests/src/CocoStudioTest/GUITest/UIScrollViewTest/UIScrollViewTest.js deleted file mode 100644 index 9a3d2bfcac..0000000000 --- a/tests/js-tests/src/CocoStudioTest/GUITest/UIScrollViewTest/UIScrollViewTest.js +++ /dev/null @@ -1,84 +0,0 @@ -/**************************************************************************** - Copyright (c) 2008-2010 Ricardo Quesada - Copyright (c) 2011-2012 cocos2d-x.org - Copyright (c) 2013-2014 Chukong Technologies Inc. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -var SCROLLVIEW_RES = [ - "ccs-res/cocosui/UIEditorTest/UIScrollView/Vertical/vertical_1.json", - "ccs-res/cocosui/UIEditorTest/UIScrollView/Horizontal/horizontal_1.json", - "ccs-res/cocosui/UIEditorTest/UIScrollView/Both/both_1.json" -]; -var SCROLLVIEW_INDEX = 0; -var UIScrollViewEditorTest = UIBaseLayer.extend({ - ctor: function () { - this._super(); - var root = this._parseUIFile(SCROLLVIEW_RES[SCROLLVIEW_INDEX]); - this._mainNode.addChild(root); - - var back_label = ccui.helper.seekWidgetByName(root, "back"); - back_label.addTouchEventListener(this.backEvent, this); - - var left_button = new ccui.Button(); - left_button.loadTextures("Images/b1.png", "Images/b2.png", ""); - left_button.x = 240-50; - left_button.y = 50; - left_button.anchorX = 0.5; - left_button.anchorY = 0.5; - left_button.zOrder = 999; - left_button.addTouchEventListener(this.previousCallback, this); - this._mainNode.addChild(left_button); - - var right_button = new ccui.Button(); - right_button.loadTextures("Images/f1.png", "Images/f2.png", ""); - right_button.x = 240+50; - right_button.y = 50; - right_button.zOrder = 999; - right_button.anchorX = 0.5; - right_button.anchorY = 0.5; - right_button.addTouchEventListener(this.nextCallback, this); - this._mainNode.addChild(right_button); - }, - - previousCallback: function (render, type) { - if (type == ccui.Widget.TOUCH_ENDED) { - SCROLLVIEW_INDEX--; - if (SCROLLVIEW_INDEX < 0)SCROLLVIEW_INDEX = SCROLLVIEW_RES.length-1; - if (SCROLLVIEW_INDEX >= SCROLLVIEW_RES.length)SCROLLVIEW_INDEX = 0; - this.runNextScene(); - } - }, - nextCallback: function (render, type) { - if (type == ccui.Widget.TOUCH_ENDED) { - SCROLLVIEW_INDEX++; - if (SCROLLVIEW_INDEX < 0)SCROLLVIEW_INDEX = SCROLLVIEW_RES.length-1; - if (SCROLLVIEW_INDEX >= SCROLLVIEW_RES.length)SCROLLVIEW_INDEX = 0; - this.runNextScene(); - } - }, - runNextScene: function () { - var scene = new cc.Scene(); - scene.addChild(new UIScrollViewEditorTest()); - cc.director.runScene(scene); - } -}); \ No newline at end of file diff --git a/tests/js-tests/src/CocoStudioTest/GUITest/UISliderTest/UISliderTest.js b/tests/js-tests/src/CocoStudioTest/GUITest/UISliderTest/UISliderTest.js deleted file mode 100644 index 5540ba681f..0000000000 --- a/tests/js-tests/src/CocoStudioTest/GUITest/UISliderTest/UISliderTest.js +++ /dev/null @@ -1,54 +0,0 @@ -/**************************************************************************** - Copyright (c) 2008-2010 Ricardo Quesada - Copyright (c) 2011-2012 cocos2d-x.org - Copyright (c) 2013-2014 Chukong Technologies Inc. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -var UISliderEditorTest = UIBaseLayer.extend({ - ctor: function () { - this._super(); - var root = this._parseUIFile("ccs-res/cocosui/UIEditorTest/UISlider/slider_1.json"); - this._mainNode.addChild(root); - - var back_label =ccui.helper.seekWidgetByName(root, "back"); - back_label.addTouchEventListener(this.backEvent,this); - - var slider = ccui.helper.seekWidgetByName(root, "Slider_738"); - slider.addEventListener(this.sliderEvent,this); - - var scale9_slider = ccui.helper.seekWidgetByName(root, "Slider_740"); - scale9_slider.addEventListener(this.sliderEvent,this); - }, - - sliderEvent: function (sender, type) { - switch (type) { - case ccui.Slider.EVENT_PERCENT_CHANGED: - var slider = sender; - var percent = slider.getPercent(); - this._topDisplayText.setString("Percent " + percent.toFixed(0)); - break; - default: - break; - } - } -}); diff --git a/tests/js-tests/src/CocoStudioTest/GUITest/UITextAtlasTest/UITextAtlasTest.js b/tests/js-tests/src/CocoStudioTest/GUITest/UITextAtlasTest/UITextAtlasTest.js deleted file mode 100644 index 2409635f67..0000000000 --- a/tests/js-tests/src/CocoStudioTest/GUITest/UITextAtlasTest/UITextAtlasTest.js +++ /dev/null @@ -1,41 +0,0 @@ -/**************************************************************************** - Copyright (c) 2008-2010 Ricardo Quesada - Copyright (c) 2011-2012 cocos2d-x.org - Copyright (c) 2013-2014 Chukong Technologies Inc. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - - -var UITextAtlasEditorTest = UIBaseLayer.extend({ - ctor: function () { - this._super(); - var root = this._parseUIFile("ccs-res/cocosui/UIEditorTest/UILabelAtlas/labelatlas_1.json"); - - this._mainNode.addChild(root); - - var label =ccui.helper.seekWidgetByName(root, "LabelAtlas_961"); - label.setString("0123456"); - - var back_label =ccui.helper.seekWidgetByName(root, "back"); - back_label.addTouchEventListener(this.backEvent,this); - } -}); \ No newline at end of file diff --git a/tests/js-tests/src/CocoStudioTest/GUITest/UITextBMFontTest/UITextBMFontTest.js b/tests/js-tests/src/CocoStudioTest/GUITest/UITextBMFontTest/UITextBMFontTest.js deleted file mode 100644 index 830038a63e..0000000000 --- a/tests/js-tests/src/CocoStudioTest/GUITest/UITextBMFontTest/UITextBMFontTest.js +++ /dev/null @@ -1,37 +0,0 @@ -/**************************************************************************** - Copyright (c) 2008-2010 Ricardo Quesada - Copyright (c) 2011-2012 cocos2d-x.org - Copyright (c) 2013-2014 Chukong Technologies Inc. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - - -var UITextBMFontEditorTest = UIBaseLayer.extend({ - ctor: function () { - this._super(); - var root = this._parseUIFile("ccs-res/cocosui/UIEditorTest/UILabelBMFont/labelbmfont_1.json"); - this._mainNode.addChild(root); - - var back_label =ccui.helper.seekWidgetByName(root, "back"); - back_label.addTouchEventListener(this.backEvent,this); - } -}); \ No newline at end of file diff --git a/tests/js-tests/src/CocoStudioTest/GUITest/UITextFieldTest/UITextFieldTest.js b/tests/js-tests/src/CocoStudioTest/GUITest/UITextFieldTest/UITextFieldTest.js deleted file mode 100644 index ff1d443fbc..0000000000 --- a/tests/js-tests/src/CocoStudioTest/GUITest/UITextFieldTest/UITextFieldTest.js +++ /dev/null @@ -1,63 +0,0 @@ -/**************************************************************************** - Copyright (c) 2008-2010 Ricardo Quesada - Copyright (c) 2011-2012 cocos2d-x.org - Copyright (c) 2013-2014 Chukong Technologies Inc. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -var UITextFieldEditorTest = UIBaseLayer.extend({ - ctor: function () { - this._super(); - var root = this._parseUIFile("ccs-res/cocosui/UIEditorTest/UITextField/textfield_1.json"); - this._mainNode.addChild(root); - - var back_label =ccui.helper.seekWidgetByName(root, "back"); - back_label.addTouchEventListener(this.backEvent,this); - - var textField_normal = ccui.helper.seekWidgetByName(root, "TextField_1109"); - textField_normal.addEventListener(this.textFieldEvent,this); - - var textField_max_character = ccui.helper.seekWidgetByName(root, "TextField_1110"); - textField_max_character.addEventListener(this.textFieldEvent,this); - - var textField_password = ccui.helper.seekWidgetByName(root, "TextField_1107"); - textField_password.addEventListener(this.textFieldEvent,this); - }, - textFieldEvent: function (sender, type) { - switch (type) { - case ccui.TextField. EVENT_ATTACH_WITH_IME: - this._topDisplayText.setString("attach with IME"); - break; - case ccui.TextField. EVENT_DETACH_WITH_IME: - this._topDisplayText.setString("detach with IME"); - break; - case ccui.TextField. EVENT_INSERT_TEXT: - this._topDisplayText.setString("insert words"); - break; - case ccui.TextField. EVENT_DELETE_BACKWARD: - this._topDisplayText.setString("delete word"); - break; - default: - break; - } - } -}); diff --git a/tests/js-tests/src/CocoStudioTest/GUITest/UITextTest/UITextTest.js b/tests/js-tests/src/CocoStudioTest/GUITest/UITextTest/UITextTest.js deleted file mode 100644 index 46b7c20a60..0000000000 --- a/tests/js-tests/src/CocoStudioTest/GUITest/UITextTest/UITextTest.js +++ /dev/null @@ -1,37 +0,0 @@ -/**************************************************************************** - Copyright (c) 2008-2010 Ricardo Quesada - Copyright (c) 2011-2012 cocos2d-x.org - Copyright (c) 2013-2014 Chukong Technologies Inc. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - - -var UITextEditorTest = UIBaseLayer.extend({ - ctor: function () { - this._super(); - var root = this._parseUIFile("ccs-res/cocosui/UIEditorTest/UILabel/label_1.json"); - this._mainNode.addChild(root); - - var back_label =ccui.helper.seekWidgetByName(root, "back"); - back_label.addTouchEventListener(this.backEvent,this); - } -}); diff --git a/tests/js-tests/src/CocoStudioTest/IssueTest/AnimationsWithOnlyOneFrame/AnimationsWithOnlyOneFrame.js b/tests/js-tests/src/CocoStudioTest/IssueTest/AnimationsWithOnlyOneFrame/AnimationsWithOnlyOneFrame.js deleted file mode 100644 index a677f06ffb..0000000000 --- a/tests/js-tests/src/CocoStudioTest/IssueTest/AnimationsWithOnlyOneFrame/AnimationsWithOnlyOneFrame.js +++ /dev/null @@ -1,102 +0,0 @@ -/**************************************************************************** - Copyright (c) 2013-2014 Chukong Technologies Inc. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -var CCSIssueAnimationsWithOnlyOneFrameLayer = cc.Layer.extend({ - - onEnter: function(){ - cc.Layer.prototype.onEnter.call(this); - - var json = ccs.load(s_testIssueAnimationsWithOnlyOneFrame_json); - var jsonNode = json.node; - jsonNode.x = this.getContentSize().width * 0.5 - jsonNode.getContentSize().width * 0.5; - jsonNode.y = this.getContentSize().height * 0.5 - jsonNode.getContentSize().height * 0.5; - - this.addChild(jsonNode); - - var winSize = director.getWinSize(); - var logLabel = new cc.LabelTTF("Issue #15714: Animations with only one frame are allowed now", "Thonburi", 16); - this.addChild(logLabel); - logLabel.x = winSize.width / 2; - logLabel.y = winSize.height / 3; - - var animationOneFramePosition = ccs.actionManager.getActionByName( - s_testIssueAnimationsWithOnlyOneFrame_json, - "AnimationOneFramePosition" - ); - - var animationOneFrameRotation = ccs.actionManager.getActionByName( - s_testIssueAnimationsWithOnlyOneFrame_json, - "AnimationOneFrameRotation" - ); - - var delayTime = 5; - var that = this; - this.runAction(cc.sequence( - cc.delayTime(delayTime), - cc.callFunc(function(target) { - if(animationOneFramePosition != null) - { - animationOneFramePosition.play(); - logLabel.setString("Animation with only one frame played! Image position should change"); - } - }, this), - cc.delayTime(delayTime), - cc.callFunc(function(target) { - if(animationOneFrameRotation != null) - { - animationOneFrameRotation.play(); - logLabel.setString("Animation with only one frame played! Image rotation should change"); - } - }, this) - )); - - } -}); - -var CCSIssueAnimationsWithOnlyOneFrameScene = cc.Scene.extend({ - - onEnter: function(){ - cc.Scene.prototype.onEnter.call(this); - - var label = new cc.LabelTTF("Back", "fonts/arial.ttf", 20); - //#endif - var pMenuItem = new cc.MenuItemLabel(label, this.BackCallback, this); - - var pMenu = new cc.Menu(pMenuItem); - - pMenu.setPosition( cc.p(0, 0) ); - pMenuItem.setPosition(cc.pAdd(cc.visibleRect.bottomRight,cc.p(-50,25))); - - this.addChild(pMenu, 1); - }, - runThisTest: function(){ - var pLayer = new CCSIssueAnimationsWithOnlyOneFrameLayer(); - this.addChild(pLayer); - cc.director.runScene(this); - }, - BackCallback: function(pSender){ - var pScene = new CCSIssueTestScene(); - pScene.runThisTest(); - } -}); \ No newline at end of file diff --git a/tests/js-tests/src/CocoStudioTest/IssueTest/CCSIssueTest.js b/tests/js-tests/src/CocoStudioTest/IssueTest/CCSIssueTest.js deleted file mode 100644 index ff445f2476..0000000000 --- a/tests/js-tests/src/CocoStudioTest/IssueTest/CCSIssueTest.js +++ /dev/null @@ -1,101 +0,0 @@ -/**************************************************************************** - Copyright (c) 2013-2014 Chukong Technologies Inc. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -var g_ccsIssuesTests = [ - { - title: "Cocos Studio 1.x Issue: Animations With Only One Frame Test", - test: function(){ - var pScene = new CCSIssueAnimationsWithOnlyOneFrameScene(); - pScene.runThisTest(); - } - } -]; - -var CCSIssueTestMainLayer = cc.Layer.extend({ - onEnter: function(){ - cc.Layer.prototype.onEnter.call(this); - - var winSize = cc.director.getWinSize(); - - var pMenu = new cc.Menu(); - pMenu.x = 0; - pMenu.y = 0; - cc.MenuItemFont.setFontName("fonts/arial.ttf"); - cc.MenuItemFont.setFontSize(24); - - for (var i = 0; i < g_ccsIssuesTests.length; ++i) { - var selItem = g_ccsIssuesTests[i]; - var pItem = new cc.MenuItemFont(selItem.title, - selItem.test, this); - pItem.x = winSize.width / 2; - pItem.y = winSize.height - (i + 1) * LINE_SPACE; - pMenu.addChild(pItem, ITEM_TAG_BASIC + i); - } - this.addChild(pMenu); - - }, - onTouchesBegan: function(touches, event){ - var touch = touches[0]; - - this._beginPos = touch.getLocation(); - }, - touchEvent: function(){ - - } - -}); - -var CCSIssueTestScene = cc.Scene.extend({ - onEnter: function(){ - cc.Scene.prototype.onEnter.call(this); - - var label = new cc.LabelTTF("Back", "fonts/arial.ttf", 20); - //#endif - var pMenuItem = new cc.MenuItemLabel(label, this.BackCallback, this); - - var pMenu = new cc.Menu(pMenuItem); - - pMenu.setPosition( cc.p(0, 0) ); - pMenuItem.setPosition(cc.pAdd(cc.visibleRect.bottomRight,cc.p(-50,25))); - - this.addChild(pMenu, 1); - - }, - runThisTest: function(){ - var pLayer = new CCSIssueTestMainLayer(); - this.addChild(pLayer); - - cc.director.runScene(this); - }, - BackCallback: function(pSender){ - var pScene = new CocoStudioTestScene(); - pScene.runThisTest(); - - } -}); - -var runCCSIssueTest = function(){ - var scene = new CCSIssueTestScene(); - scene.runThisTest(); -}; \ No newline at end of file diff --git a/tests/js-tests/src/CocoStudioTest/ParserTest/ParserTest.js b/tests/js-tests/src/CocoStudioTest/ParserTest/ParserTest.js deleted file mode 100644 index 2ce7d108be..0000000000 --- a/tests/js-tests/src/CocoStudioTest/ParserTest/ParserTest.js +++ /dev/null @@ -1,156 +0,0 @@ -/**************************************************************************** - Copyright (c) 2013-2014 Chukong Technologies Inc. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - - -var g_parsersTests = [ - { - title: "cocostudio 1.3", - test: function(){ - new CocostudioParserJsonScene("ccs-res/cocosui/UIEditorTest/cocostudio1_3/CocostudioV1_3_1.ExportJson").runThisTest(); - } - },{ - title: "cocostudio 1.4", - test: function(){ - new CocostudioParserJsonScene("ccs-res/cocosui/UIEditorTest/cocostudio1_4/Cocostudio1_4_1.ExportJson").runThisTest(); - } - },{ - title: "cocostudio 1.5", - test: function(){ - new CocostudioParserJsonScene("ccs-res/cocosui/UIEditorTest/cocostudio1_5/Cocostudio1_5_1.ExportJson").runThisTest(); - } - },{ - title: "cocostudio 2.1", - test: function(){ - new CocostudioParserJsonScene("ccs-res/cocosui/UIEditorTest/2.1/MainScene.json").runThisTest(); - } - } -]; - -var runParserTest = function () { - var pScene = new CocostudioParserJsonScene(); - if (pScene) { - pScene.runThisTest(); - } -}; - -var CocostudioParserJsonLayer = cc.Layer.extend({ - - _jsonFile: null, - - ctor: function(jsonFile){ - this._super(); - this._jsonFile = jsonFile; - }, - - onEnter: function(){ - this._super(); - cc.Layer.prototype.onEnter.call(this); - - var layout; - if(cocoStudioOldApiFlag == 0){ - cc.log("ccs.load : %s", this._jsonFile); - var json = ccs.load(this._jsonFile); - layout = json.node; - }else{ - //ccs.uiReader.widgetFromJsonFile only supports 1.x file - cc.log("ccs.uiReader.widgetFromJsonFile : %s", this._jsonFile); - var guiReader = ccs.uiReader; - layout = guiReader.widgetFromJsonFile(this._jsonFile); - } - if(layout){ - if(layout.getScale() == 1) - layout.setScale(0.7); - - this.addChild(layout); - } - } -}); - -var CocostudioParserJsonScene = cc.Scene.extend({ - - _jsonFile: null, - - ctor: function(jsonFile){ - this._super(); - if(jsonFile){ - this._jsonFile = jsonFile; - } - }, - - onEnter: function(){ - cc.Scene.prototype.onEnter.call(this); - - var label = new cc.LabelTTF("Back", "fonts/arial.ttf", 20); - //#endif - var pMenuItem = new cc.MenuItemLabel(label, this.BackCallback, this); - - var pMenu = new cc.Menu(pMenuItem); - - pMenu.setPosition( cc.p(0, 0) ); - pMenuItem.setPosition( cc.pAdd(cc.visibleRect.bottomRight,cc.p(-50,25)) ); - - this.addChild(pMenu, 1); - - }, - runThisTest: function(){ - if(this._jsonFile){ - var pLayer = new CocostudioParserJsonLayer(this._jsonFile); - this.addChild(pLayer); - }else{ - var winSize = cc.director.getWinSize(); - - var pMenu = new cc.Menu(); - pMenu.x = 0; - pMenu.y = 0; - cc.MenuItemFont.setFontName("fonts/arial.ttf"); - cc.MenuItemFont.setFontSize(24); - var testNum = 0; - if(cocoStudioOldApiFlag == 0){ - testNum = g_parsersTests.length; - }else{ - testNum = g_parsersTests.length - 1; - } - for (var i = 0; i < testNum; ++i) { - var selItem = g_parsersTests[i]; - var pItem = new cc.MenuItemFont(selItem.title, - selItem.test, this); - pItem.x = winSize.width / 2; - pItem.y = winSize.height - (i + 1) * LINE_SPACE; - pMenu.addChild(pItem, ITEM_TAG_BASIC + i); - } - this.addChild(pMenu); - } - - cc.director.runScene(this); - }, - BackCallback: function(){ - cc.audioEngine.stopMusic(); - cc.audioEngine.stopAllEffects(); - if(this._jsonFile){ - new CocostudioParserJsonScene().runThisTest(); - }else{ - new CocoStudioTestScene().runThisTest(); - } - } -}); \ No newline at end of file diff --git a/tests/js-tests/src/CocoStudioTest/SceneTest/SceneEditorTest.js b/tests/js-tests/src/CocoStudioTest/SceneTest/SceneEditorTest.js deleted file mode 100644 index 451a961640..0000000000 --- a/tests/js-tests/src/CocoStudioTest/SceneTest/SceneEditorTest.js +++ /dev/null @@ -1,547 +0,0 @@ -/**************************************************************************** - Copyright (c) 2008-2010 Ricardo Quesada - Copyright (c) 2011-2012 cocos2d-x.org - Copyright (c) 2013-2014 Chukong Technologies Inc. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ - -var sceneTestIdx = -1; - -var SceneEditorScene = TestScene.extend({ - onEnter: function () { - this._super(); - }, - runThisTest: function () { - sceneTestIdx = -1; - this.addChild(nextSceneEditorTest()); - director.runScene(this); - }, - onMainMenuCallback: function () { - var scene = new CocoStudioTestScene(); - scene.runThisTest(); - }, - onExit: function () { - this._super(); - } -}); -var sceneEditorArr = [ - function () { - return new LoadSceneEdtiorFileTest(); - }, - function () { - return new SpriteComponentTest(); - }, - function () { - return new ArmatureComponentTest(); - }, - function () { - return new UIComponentTest(); - }, - function () { - return new TmxMapComponentTest(); - }, - function () { - return new ParticleComponentTest(); - }, - function () { - return new EffectComponentTest(); - }, - function () { - return new BackgroundComponentTest(); - }, - function () { - return new AttributeComponentTest(); - }, - function () { - return new TriggerTest(); - } -]; - -var nextSceneEditorTest = function () { - sceneTestIdx++; - sceneTestIdx = sceneTestIdx % sceneEditorArr.length; - return sceneEditorArr[sceneTestIdx](); -}; - -var backSceneEditorTest = function () { - sceneTestIdx--; - if (sceneTestIdx < 0) - sceneTestIdx += sceneEditorArr.length; - - return sceneEditorArr[sceneTestIdx](); -}; - -var restartSceneEditorTest = function () { - return sceneEditorArr[sceneTestIdx](); -}; -var SceneEditorTestLayer = BaseTestLayer.extend({ - ctor: function () { - if (arguments.length === 0) { - this._super(cc.color(0, 0, 0, 255), cc.color(98, 99, 117, 255)); - } else { - this._super.apply(this, arguments); - } - }, - - onRestartCallback: function (sender) { - var s = new SceneEditorScene(); - s.addChild(restartSceneEditorTest()); - director.runScene(s); - }, - - onNextCallback: function (sender) { - var s = new SceneEditorScene(); - s.addChild(nextSceneEditorTest()); - director.runScene(s); - }, - - onBackCallback: function (sender) { - var s = new SceneEditorScene(); - s.addChild(backSceneEditorTest()); - director.runScene(s); - }, - onExit: function () { - ccs.armatureDataManager.clear(); - ccs.sceneReader.clear(); - ccs.actionManager.clear(); - ccs.uiReader.clear(); - this._super(); - }, - initSize:function(node){ - var winSize = cc.director.getWinSize(); - var scale = winSize.height / 320; - node.scale = scale; - node.x = (winSize.width - 480 * scale) / 2; - node.y = (winSize.height - 320 * scale) / 2; - } -}); - -var runSceneEditorTest = function () { - var pScene = new SceneEditorScene(); - if (pScene) { - pScene.runThisTest(); - } -}; - -//------------------------------------------------------------------ -// -// LoadSceneEdtiorFileTest -// -//------------------------------------------------------------------ -var LoadSceneEdtiorFileTest = SceneEditorTestLayer.extend({ - onEnter: function () { - this._super(); - var node, - file = "ccs-res/scenetest/LoadSceneEdtiorFileTest/FishJoy2.json"; - if(cocoStudioOldApiFlag == 0){ - cc.log("ccs.load : %s", file); - var json = ccs.load(file); - node = json.node; - }else{ - //ccs.sceneReader only supports 1.x file - cc.log("ccs.sceneReader.createNodeWithSceneFile : %s", file); - node = ccs.sceneReader.createNodeWithSceneFile(file); - } - this.addChild(node); - ccs.actionManager.playActionByName("startMenu_1.json", "Animation1"); - this.initSize(node); - }, - onExit: function() { - ccs.actionManager.releaseActions(); - this._super(); - }, - title: function () { - return "loadSceneEdtiorFile Test"; - } -}); - -//------------------------------------------------------------------ -// -// SpriteComponentTest -// -//------------------------------------------------------------------ -var SpriteComponentTest = SceneEditorTestLayer.extend({ - onEnter: function () { - this._super(); - var node, - file = "ccs-res/scenetest/SpriteComponentTest/SpriteComponentTest.json"; - if(cocoStudioOldApiFlag == 0){ - cc.log("ccs.load : %s", file); - var json = ccs.load(file); - node = json.node; - }else{ - //ccs.sceneReader only supports 1.x file - cc.log("ccs.sceneReader.createNodeWithSceneFile : %s", file); - node = ccs.sceneReader.createNodeWithSceneFile(file); - } - this.addChild(node); - - var action1 = cc.blink(2, 10); - var action2 = cc.blink(2, 5); - var sister1 = node.getChildByTag(10003).getComponent("CCSprite").getNode(); - sister1.runAction(action1); - - var sister2 = node.getChildByTag(10004).getComponent("CCSprite").getNode(); - sister2.runAction(action2); - - this.initSize(node); - }, - title: function () { - return "Sprite Component Test"; - } -}); - -//------------------------------------------------------------------ -// -// ArmatureComponentTest -// -//------------------------------------------------------------------ -var ArmatureComponentTest = SceneEditorTestLayer.extend({ - onEnter: function () { - this._super(); - var node, - file = "ccs-res/scenetest/ArmatureComponentTest/ArmatureComponentTest.json"; - if(cocoStudioOldApiFlag == 0){ - cc.log("ccs.load : %s", file); - var json = ccs.load(file); - node = json.node;ccs.load(file); - }else{ - //ccs.sceneReader only supports 1.x file - cc.log("ccs.sceneReader.createNodeWithSceneFile : %s", file); - node = ccs.sceneReader.createNodeWithSceneFile(file); - } - this.addChild(node); - - var blowFish = node.getChildByTag(10007).getComponent("CCArmature").getNode(); - blowFish.runAction(cc.moveBy(10, cc.p(-1000, 0))); - - var butterFlyFish = node.getChildByTag(10008).getComponent("CCArmature").getNode(); - butterFlyFish.runAction(cc.moveBy(10, cc.p(-1000, 0))); - - this.initSize(node); - }, - title: function () { - return "Armature Component Test"; - } -}); - -//------------------------------------------------------------------ -// -// UIComponentTest -// -//------------------------------------------------------------------ -var UIComponentTest = SceneEditorTestLayer.extend({ - _node: null, - onEnter: function () { - this._super(); - var node, - file = "ccs-res/scenetest/UIComponentTest/UIComponentTest.json"; - if(cocoStudioOldApiFlag == 0){ - cc.log("ccs.load : %s", file); - var json = ccs.load(file); - node = json.node; - }else{ - //ccs.sceneReader only supports 1.x file - cc.log("ccs.sceneReader.createNodeWithSceneFile : %s", file); - node = ccs.sceneReader.createNodeWithSceneFile(file); - } - this._node = node; - this.addChild(this._node); - var widget = this._node.getChildByTag(10025).getComponent("GUIComponent").getNode(); - var button = widget.getChildByName("Button_156"); - button.addTouchEventListener(this.touchEvent, this); - - this.initSize(this._node); - }, - touchEvent: function (sender, type) { - switch (type) { - case ccui.Widget.TOUCH_BEGAN: - var blowFish = this._node.getChildByTag(10010).getComponent("CCArmature").getNode(); - blowFish.runAction(cc.moveBy(10, cc.p(-1000, 0))); - - var butterFlyFish = this._node.getChildByTag(10011).getComponent("CCArmature").getNode(); - butterFlyFish.runAction(cc.moveBy(10, cc.p(-1000.0, 0))); - break; - default: - break; - } - }, - title: function () { - return "UI Component Test"; - } -}); - -//------------------------------------------------------------------ -// -// TmxMapComponentTest -// -//------------------------------------------------------------------ -var TmxMapComponentTest = SceneEditorTestLayer.extend({ - onEnter: function () { - this._super(); - var node, - file = "ccs-res/scenetest/TmxMapComponentTest/TmxMapComponentTest.json"; - if(cocoStudioOldApiFlag == 0){ - cc.log("ccs.load : %s", file); - var json = ccs.load(file); - node = json.node; - }else{ - //ccs.sceneReader only supports 1.x file - cc.log("ccs.sceneReader.createNodeWithSceneFile : %s", file); - node = ccs.sceneReader.createNodeWithSceneFile(file); - } - this.addChild(node); - var tmxMap = node.getChildByTag(10015).getComponent("CCTMXTiledMap").getNode(); - var actionTo = cc.skewTo(2, 0, 2); - var rotateTo = cc.rotateTo(2, 61); - var actionScaleTo = cc.scaleTo(2, -0.44, 0.47); - - var actionScaleToBack = cc.scaleTo(2, 1, 1); - var rotateToBack = cc.rotateTo(2, 0); - var actionToBack = cc.skewTo(2, 0, 0); - - tmxMap.runAction(cc.sequence(actionTo, actionToBack)); - tmxMap.runAction(cc.sequence(rotateTo, rotateToBack)); - tmxMap.runAction(cc.sequence(actionScaleTo, actionScaleToBack)); - - this.initSize(node); - }, - title: function () { - return "TmxMap Component Test"; - } -}); - - -//------------------------------------------------------------------ -// -// ParticleComponentTest -// -//------------------------------------------------------------------ -var ParticleComponentTest = SceneEditorTestLayer.extend({ - onEnter: function () { - this._super(); - var node, - file = "ccs-res/scenetest/ParticleComponentTest/ParticleComponentTest.json"; - if(cocoStudioOldApiFlag == 0){ - cc.log("ccs.load : %s", file); - var json = ccs.load(file); - node = json.node; - }else{ - //ccs.sceneReader only supports 1.x file - cc.log("ccs.sceneReader.createNodeWithSceneFile : %s", file); - node = ccs.sceneReader.createNodeWithSceneFile(file); - } - this.addChild(node); - - var particle = node.getChildByTag(10020).getComponent("CCParticleSystemQuad").getNode(); - var jump = cc.jumpBy(5, cc.p(-500, 0), 50, 4); - var action = cc.sequence(jump, jump.reverse()); - particle.runAction(action); - - this.initSize(node); - }, - title: function () { - return "Particle Component Test"; - } -}); - -//------------------------------------------------------------------ -// -// EffectComponentTest -// -//------------------------------------------------------------------ -var EffectComponentTest = SceneEditorTestLayer.extend({ - _node: null, - onEnter: function () { - this._super(); - var node, - file = "ccs-res/scenetest/EffectComponentTest/EffectComponentTest.json"; - if(cocoStudioOldApiFlag == 0){ - cc.log("ccs.load : %s", file); - var json = ccs.load(file); - node = json.node; - }else{ - //ccs.sceneReader only supports 1.x file - cc.log("ccs.sceneReader.createNodeWithSceneFile : %s", file); - node = ccs.sceneReader.createNodeWithSceneFile(file); - } - this._node = node; - this.addChild(this._node); - - var armature = this._node.getChildByTag(10015).getComponent("CCArmature").getNode(); - armature.getAnimation().setMovementEventCallFunc(this.animationEvent, this); - - this.initSize(this._node); - }, - title: function () { - return "Effect Component Test"; - }, - animationEvent: function (armature, movementType, movementID) { - if (movementType == ccs.MovementEventType.loopComplete) { - if (movementID == "Fire") { - var audio = this._node.getChildByTag(10015).getComponent("CCComAudio"); - audio.playEffect(); - } - } - } -}); - -//------------------------------------------------------------------ -// -// BackgroundComponentTest -// -//------------------------------------------------------------------ -var BackgroundComponentTest = SceneEditorTestLayer.extend({ - onEnter: function () { - this._super(); - var node, - file = "ccs-res/scenetest/BackgroundComponentTest/BackgroundComponentTest.json"; - if(cocoStudioOldApiFlag == 0){ - cc.log("ccs.load : %s", file); - var json = ccs.load(file); - node = json.node; - }else{ - //ccs.sceneReader only supports 1.x file - cc.log("ccs.sceneReader.createNodeWithSceneFile : %s", file); - node = ccs.sceneReader.createNodeWithSceneFile(file); - } - this.addChild(node); - ccs.actionManager.playActionByName("startMenu_1.json", "Animation1"); - - var audio = node.getComponent("CCBackgroundAudio"); - audio.playBackgroundMusic(); - - this.initSize(node); - }, - onExit: function() { - ccs.actionManager.releaseActions(); - this._super(); - }, - title: function () { - return "Background Component Test"; - } -}); - -//------------------------------------------------------------------ -// -// AttributeComponentTest -// -//------------------------------------------------------------------ -var AttributeComponentTest = SceneEditorTestLayer.extend({ - onEnter: function () { - this._super(); - var node, - file = "ccs-res/scenetest/AttributeComponentTest/AttributeComponentTest.json"; - if(cocoStudioOldApiFlag == 0){ - cc.log("ccs.load : %s", file); - var json = ccs.load(file); - node = json.node; - }else{ - //ccs.sceneReader only supports 1.x file - cc.log("ccs.sceneReader.createNodeWithSceneFile : %s", file); - node = ccs.sceneReader.createNodeWithSceneFile(file); - } - this.addChild(node); - - var comAttribute = node.getChildByTag(10015).getComponent("CCComAttribute"); - cc.log("name:" + comAttribute.getString("name")); - cc.log("maxHP:" + comAttribute.getFloat("maxHP")); - cc.log("maxMP:" + comAttribute.getFloat("maxMP")); - - this.initSize(node); - }, - title: function () { - return "Attribute Component Test"; - }, - subtitle:function(){ - return "See console"; - } -}); - -//------------------------------------------------------------------ -// -// TriggerTest -// -//------------------------------------------------------------------ -var TriggerTest = SceneEditorTestLayer.extend({ - _blowFishNode: null, - _flyFishNode: null, - onEnter: function () { - this._super(); - var node, - file = "ccs-res/scenetest/TriggerTest/TriggerTest.json"; - if(cocoStudioOldApiFlag == 0){ - cc.log("ccs.load : %s", file); - var json = ccs.load(file); - node = json.node; - }else{ - //ccs.sceneReader only supports 1.x file - cc.log("ccs.sceneReader.createNodeWithSceneFile : %s", file); - node = ccs.sceneReader.createNodeWithSceneFile(file); - } - this.addChild(node); - ccs.actionManager.playActionByName("startMenu_1.json", "Animation1"); - - this.schedule(this.gameLogic); - ccs.sendEvent(TRIGGER_EVENT_ENTERSCENE); - - var listener1 = cc.EventListener.create({ - event: cc.EventListener.TOUCH_ONE_BY_ONE, - swallowTouches: true, - onTouchBegan: this.onTouchBegan.bind(this), - onTouchMoved: this.onTouchMoved.bind(this), - onTouchEnded: this.onTouchEnded.bind(this) - }); - cc.eventManager.addListener(listener1, this); - this.initSize(node); - }, - onExit: function () { - ccs.actionManager.releaseActions(); - ccs.sendEvent(TRIGGER_EVENT_LEAVESCENE); - this.unschedule(this.gameLogic, this); - this._super(); - }, - - onTouchBegan: function (touch, event) { - ccs.sendEvent(TRIGGER_EVENT_TOUCHBEGAN); - return true; - }, - - onTouchMoved: function (touch, event) { - ccs.sendEvent(TRIGGER_EVENT_TOUCHMOVED); - }, - - onTouchEnded: function (touch, event) { - ccs.sendEvent(TRIGGER_EVENT_TOUCHENDED); - }, - - onTouchCancelled: function (touch, event) { - ccs.sendEvent(TRIGGER_EVENT_TOUCHCANCELLED); - }, - - gameLogic: function () { - ccs.sendEvent(TRIGGER_EVENT_UPDATESCENE); - }, - title: function () { - return "Trigger Test"; - } -}); diff --git a/tests/js-tests/src/CocoStudioTest/SceneTest/TriggerCode/Acts.js b/tests/js-tests/src/CocoStudioTest/SceneTest/TriggerCode/Acts.js deleted file mode 100644 index c25e015603..0000000000 --- a/tests/js-tests/src/CocoStudioTest/SceneTest/TriggerCode/Acts.js +++ /dev/null @@ -1,642 +0,0 @@ -/**************************************************************************** - Copyright (c) 2008-2010 Ricardo Quesada - Copyright (c) 2011-2012 cocos2d-x.org - Copyright (c) 2013-2014 Chukong Technologies Inc. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ -var PlayMusic = ccs.BaseTriggerAction.extend({ - _tag: -1, - _comName: "", - _type: -1, - ctor: function () { - this._tag = -1; - this._comName = ""; - this._type = -1; - }, - - init: function () { - return true; - }, - - done: function () { - var node = ccs.sceneReader.getNodeByTag(this._tag); - if (!node) - return; - var audio = node.getComponent(this._comName); - if (!audio) - return; - if (this._type == 0) { - audio.playBackgroundMusic(); - } - else if (this._type == 1) { - audio.playEffect(); - } - }, - - serialize: function (jsonVal) { - var dataitems = jsonVal["dataitems"] || []; - for (var i = 0; i < dataitems.length; i++) { - var subDict = dataitems[i]; - var key = subDict["key"]; - if (key == "Tag") { - this._tag = subDict["value"]; - continue; - } - if (key == "componentName") { - this._comName = subDict["value"]; - continue; - } - if (key == "type") { - this._type = subDict["value"]; - } - } - }, - - removeAll: function () { - } -}); - -var TMoveTo = ccs.BaseTriggerAction.extend({ - _tag: -1, - _duration: 0, - _pos: cc.p(0, 0), - ctor: function () { - this._tag = -1; - this._duration = 0; - this._pos = cc.p(0, 0); - }, - - init: function () { - return true; - }, - - done: function () { - var node = ccs.sceneReader.getNodeByTag(this._tag); - if (!node) - return; - var actionTo = cc.moveTo(this._duration, cc.p(this._pos.x, this._pos.y)); - node.runAction(actionTo); - }, - - serialize: function (jsonVal) { - var dataitems = jsonVal["dataitems"] || []; - for (var i = 0; i < dataitems.length; i++) { - var subDict = dataitems[i]; - - var key = subDict["key"]; - if (key == "Tag") { - this._tag = subDict["value"]; - continue; - } - if (key == "Duration") { - this._duration = subDict["value"]; - continue; - } - if (key == "x") { - this._pos.x = subDict["value"]; - continue; - } - if (key == "y") { - this._pos.y = subDict["value"]; - } - } - }, - - removeAll: function () { - var node = ccs.sceneReader.getNodeByTag(this._tag); - node.actionManager.removeAllActions(); - } -}); - -var TMoveBy = ccs.BaseTriggerAction.extend({ - _tag: -1, - _duration: 0, - _pos: cc.p(0, 0), - _reverse: false, - ctor: function () { - this._tag = -1; - this._duration = 0; - this._pos = cc.p(0, 0); - this._reverse = false; - }, - - init: function () { - return true; - }, - - done: function () { - var node = ccs.sceneReader.getNodeByTag(this._tag); - if (!node) - return; - var moveBy = cc.moveBy(this._duration, cc.p(this._pos.x, this._pos.y)); - if (this._reverse) { - var actionByBack = moveBy.reverse(); - node.runAction(cc.sequence(moveBy, actionByBack)); - } else { - node.runAction(moveBy); - } - }, - - serialize: function (jsonVal) { - var dataitems = jsonVal["dataitems"] || []; - for (var i = 0; i < dataitems.length; i++) { - var subDict = dataitems[i]; - - var key = subDict["key"]; - if (key == "Tag") { - this._tag = subDict["value"]; - continue; - } - if (key == "Duration") { - this._duration = subDict["value"]; - continue; - } - if (key == "x") { - this._pos.x = subDict["value"]; - continue; - } - if (key == "y") { - this._pos.y = subDict["value"]; - continue; - } - if (key == "IsReverse") { - this._reverse = subDict["value"] || false; - } - } - }, - - removeAll: function () { - var node = ccs.sceneReader.getNodeByTag(this._tag); - node.actionManager.removeAllActions(); - } -}); - -var TRotateTo = ccs.BaseTriggerAction.extend({ - _tag: -1, - _duration: 0, - _deltaAngle: 0, - ctor: function () { - this._tag = -1; - this._duration = 0; - this._deltaAngle = 0; - }, - - init: function () { - return true; - }, - - done: function () { - var node = ccs.sceneReader.getNodeByTag(this._tag); - if (!node) - return; - var actionTo = cc.rotateTo(this._duration, this._deltaAngle); - node.runAction(actionTo); - }, - - serialize: function (jsonVal) { - var dataitems = jsonVal["dataitems"] || []; - for (var i = 0; i < dataitems.length; i++) { - var subDict = dataitems[i]; - - var key = subDict["key"]; - if (key == "Tag") { - this._tag = subDict["value"]; - continue; - } - if (key == "Duration") { - this._duration = subDict["value"]; - continue; - } - if (key == "DeltaAngle") { - this._deltaAngle = subDict["value"]; - } - } - }, - - removeAll: function () { - var node = ccs.sceneReader.getNodeByTag(this._tag); - node.actionManager.removeAllActions(); - } -}); - -var TRotateBy = ccs.BaseTriggerAction.extend({ - _tag: -1, - _duration: 0, - _deltaAngle: 0, - _reverse: false, - ctor:function(){ - this._tag = -1; - this._duration = 0; - this._deltaAngle = 0; - this._reverse = false; - }, - - init: function () { - return true; - }, - - done: function () { - var node = ccs.sceneReader.getNodeByTag(this._tag); - if (!node) - return; - var actionBy = cc.rotateBy(this._duration, this._deltaAngle); - if (this._reverse == true) { - var actionByBack = actionBy.reverse(); - node.runAction(cc.sequence(actionBy, actionByBack)); - } - else { - node.runAction(actionBy); - } - }, - - serialize: function (jsonVal) { - var dataitems = jsonVal["dataitems"] || []; - for (var i = 0; i < dataitems.length; i++) { - var subDict = dataitems[i]; - - var key = subDict["key"]; - if (key == "Tag") { - this._tag = subDict["value"]; - continue; - } - if (key == "Duration") { - this._duration = subDict["value"]; - continue; - } - if (key == "DeltaAngle") { - this._deltaAngle = subDict["value"]; - continue; - } - if (key == "IsReverse") { - this._reverse = subDict["value"]; - } - } - }, - - removeAll: function () { - var node = ccs.sceneReader.getNodeByTag(this._tag); - node.actionManager.removeAllActions(); - } -}); - -var TScaleTo = ccs.BaseTriggerAction.extend({ - _tag: -1, - _duration: 0, - _scaleX: 0, - _scaleY: 0, - ctor: function () { - this._tag = -1; - this._duration = 0; - this._scaleX = 0; - this._scaleY = 0; - }, - - init: function () { - return true; - }, - - done: function () { - var node = ccs.sceneReader.getNodeByTag(this._tag); - if (!node) - return; - var actionTo = cc.scaleTo(this._duration, this._scaleX, this._scaleY); - node.runAction(actionTo); - }, - - serialize: function (jsonVal) { - var dataitems = jsonVal["dataitems"] || []; - for (var i = 0; i < dataitems.length; i++) { - var subDict = dataitems[i]; - - var key = subDict["key"]; - if (key == "Tag") { - this._tag = subDict["value"]; - continue; - } - if (key == "Duration") { - this._duration = subDict["value"]; - continue; - } - if (key == "ScaleX") { - this._scaleX = subDict["value"]; - continue; - } - if (key == "ScaleY") { - this._scaleY = subDict["value"]; - } - } - }, - - removeAll: function () { - var node = ccs.sceneReader.getNodeByTag(this._tag); - node.actionManager.removeAllActions(); - } -}); - -var TScaleBy = ccs.BaseTriggerAction.extend({ - _tag: -1, - _duration: 0, - _scaleX: 0, - _scaleY: 0, - _reverse: false, - ctor: function () { - this._tag = -1; - this._duration = 0; - this._scaleX = 0; - this._scaleY = 0; - this._reverse = false; - }, - - init: function () { - return true; - }, - - done: function () { - var node = ccs.sceneReader.getNodeByTag(this._tag); - if (!node) - return; - var actionBy = cc.scaleBy(this._duration, this._scaleX, this._scaleY); - if (this._reverse == true) { - var actionByBack = actionBy.reverse(); - node.runAction(cc.sequence(actionBy, actionByBack)); - } - else { - node.runAction(actionBy); - } - }, - - serialize: function (jsonVal) { - var dataitems = jsonVal["dataitems"] || []; - for (var i = 0; i < dataitems.length; i++) { - var subDict = dataitems[i]; - - var key = subDict["key"]; - if (key == "Tag") { - this._tag = subDict["value"]; - continue; - } - if (key == "Duration") { - this._duration = subDict["value"]; - continue; - } - if (key == "ScaleX") { - this._scaleX = subDict["value"]; - continue; - } - if (key == "ScaleY") { - this._scaleY = subDict["value"]; - } - } - }, - - removeAll: function () { - var node = ccs.sceneReader.getNodeByTag(this._tag); - node.actionManager.removeAllActions(); - } -}); - -var TSkewTo = ccs.BaseTriggerAction.extend({ - _tag: -1, - _duration: 0, - _skewX: 0, - _skewY: 0, - ctor: function () { - this._tag = -1; - this._duration = 0; - this._skewX = 0; - this._skewY = 0; - }, - - init: function () { - return true; - }, - - done: function () { - var node = ccs.sceneReader.getNodeByTag(this._tag); - if (!node) - return; - var actionTo = cc.skewTo(this._duration, this._skewX, this._skewY); - node.runAction(actionTo); - }, - - serialize: function (jsonVal) { - var dataitems = jsonVal["dataitems"] || []; - for (var i = 0; i < dataitems.length; i++) { - var subDict = dataitems[i]; - - var key = subDict["key"]; - if (key == "Tag") { - this._tag = subDict["value"]; - continue; - } - if (key == "Duration") { - this._duration = subDict["value"]; - continue; - } - if (key == "SkewX") { - this._skewX = subDict["value"]; - continue; - } - if (key == "SkewY") { - this._skewY = subDict["value"]; - } - } - }, - - removeAll: function () { - var node = ccs.sceneReader.getNodeByTag(this._tag); - node.actionManager.removeAllActions(); - } -}); - -var TSkewBy = ccs.BaseTriggerAction.extend({ - _tag: -1, - _duration: 0, - _skewX: 0, - _skewY: 0, - _reverse: false, - ctor: function () { - this._tag = -1; - this._duration = 0; - this._skewX = 0; - this._skewY = 0; - this._reverse = false; - }, - - init: function () { - return true; - }, - - done: function () { - var node = ccs.sceneReader.getNodeByTag(this._tag); - if (!node) - return; - var actionBy = cc.skewBy(this._duration, this._skewX, this._skewY); - if (this._reverse == true) { - var actionByBack = actionBy.reverse(); - node.runAction(cc.sequence(actionBy, actionByBack)); - } - else { - node.runAction(actionBy); - } - }, - - serialize: function (jsonVal) { - var dataitems = jsonVal["dataitems"] || []; - for (var i = 0; i < dataitems.length; i++) { - var subDict = dataitems[i]; - - var key = subDict["key"]; - if (key == "Tag") { - this._tag = subDict["value"]; - continue; - } - if (key == "Duration") { - this._duration = subDict["value"]; - continue; - } - if (key == "SkewX") { - this._skewX = subDict["value"]; - continue; - } - if (key == "SkewY") { - this._skewY = subDict["value"]; - } - } - }, - - removeAll: function () { - var node = ccs.sceneReader.getNodeByTag(this._tag); - node.actionManager.removeAllActions(); - } -}); - -var TriggerState = ccs.BaseTriggerAction.extend({ - _id: -1, - _state: 0, - ctor: function () { - this._id = -1; - this._state = 0; - }, - - init: function () { - return true; - }, - - done: function () { - var obj = ccs.triggerManager.getTriggerObj(this._id); - if (obj) { - if (this._state == 0) { - obj.setEnable(false); - } - else if (this._state == 1) { - obj.setEnable(true); - } - else if (this._state == 2) { - ccs.triggerManager.removeTriggerObj(this._id); - } - - } - }, - - serialize: function (jsonVal) { - var dataitems = jsonVal["dataitems"] || []; - for (var i = 0; i < dataitems.length; i++) { - var subDict = dataitems[i]; - - var key = subDict["key"]; - if (key == "ID") { - this._id = subDict["value"]; - continue; - } - if (key == "State") { - this._state = subDict["value"]; - } - } - }, - - removeAll: function () { - } -}); - -var ArmaturePlayAction = ccs.BaseTriggerAction.extend({ - _tag: -1, - _comName: 0, - _aniName: "", - ctor: function () { - this._tag = -1; - this._comName = 0; - this._aniName = ""; - }, - - init: function () { - return true; - }, - - done: function () { - var node = ccs.sceneReader.getNodeByTag(this._tag); - if (!node) - return; - var render = node.getComponent(this._comName); - if (!render) - return; - var armature = render.getNode(); - if (!armature) - return; - armature.getAnimation().play(this._aniName); - }, - - serialize: function (jsonVal) { - var dataitems = jsonVal["dataitems"] || []; - for (var i = 0; i < dataitems.length; i++) { - var subDict = dataitems[i]; - - var key = subDict["key"]; - if (key == "ID") { - this._id = subDict["value"]; - continue; - } - if (key == "componentName") { - this._comName = subDict["value"]; - continue; - } - if (key == "AnimationName") { - this._aniName = subDict["value"]; - } - } - }, - - removeAll: function () { - } -}); - -ccs.registerTriggerClass("PlayMusic", PlayMusic); -ccs.registerTriggerClass("TMoveTo", TMoveTo); -ccs.registerTriggerClass("TMoveBy", TMoveBy); -ccs.registerTriggerClass("TRotateTo", TRotateTo); -ccs.registerTriggerClass("TRotateBy", TRotateBy); -ccs.registerTriggerClass("TScaleTo", TScaleTo); -ccs.registerTriggerClass("TScaleBy", TScaleBy); -ccs.registerTriggerClass("TSkewTo", TSkewTo); -ccs.registerTriggerClass("TSkewBy", TSkewBy); -ccs.registerTriggerClass("TriggerState", TriggerState); -ccs.registerTriggerClass("ArmaturePlayAction", ArmaturePlayAction); \ No newline at end of file diff --git a/tests/js-tests/src/CocoStudioTest/SceneTest/TriggerCode/Cons.js b/tests/js-tests/src/CocoStudioTest/SceneTest/TriggerCode/Cons.js deleted file mode 100644 index 3cc6a1cb6a..0000000000 --- a/tests/js-tests/src/CocoStudioTest/SceneTest/TriggerCode/Cons.js +++ /dev/null @@ -1,245 +0,0 @@ -/**************************************************************************** - Copyright (c) 2008-2010 Ricardo Quesada - Copyright (c) 2011-2012 cocos2d-x.org - Copyright (c) 2013-2014 Chukong Technologies Inc. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ -var TimeElapsed = ccs.BaseTriggerCondition.extend({ - _totalTime: 0, - _tmpTime: 0, - _scheduler: null, - _success: false, - ctor: function () { - this._totalTime = 0; - this._tmpTime = 0; - this._scheduler = null; - this._success = false; - this._scheduler = cc.director.getScheduler(); - }, - - init: function () { - this._scheduler.scheduleCallbackForTarget(this, this.update); - return true; - }, - - detect: function () { - return this._success; - }, - - serialize: function (jsonVal) { - var dataitems = jsonVal["dataitems"] || []; - for (var i = 0; i < dataitems.length; i++) { - var subDict = dataitems[i]; - var key = subDict["key"]; - if (key == "TotalTime") { - this._totalTime = subDict["value"]; - } - } - }, - - removeAll: function () { - this._scheduler.unscheduleUpdateForTarget(this); - }, - - update: function (dt) { - this._tmpTime += dt; - if (this._tmpTime > this._totalTime) { - this._tmpTime = 0.0; - this._success = true; - } - } -}); -var ArmatureActionState = ccs.BaseTriggerCondition.extend({ - _tag: -1, - _state: -1, - _success: false, - _aniName: "", - _comName: "", - _armature: null, - ctor: function () { - this._tag = -1; - this._state = -1; - this._success = false; - this._aniName = ""; - this._comName = ""; - this._armature = null; - }, - - init: function () { - var node = ccs.sceneReader.getNodeByTag(this._tag); - if (!node) return false; - var render = node.getComponent(this._comName); - if (!render) return false; - var armature = render.getNode(); - if (!armature) return false; - this._armature = armature; - ccs.triggerManager.addArmatureMovementCallBack(this._armature, this.animationEvent, this); - return true; - }, - - detect: function () { - return this._success; - }, - - serialize: function (jsonVal) { - var dataitems = jsonVal["dataitems"] || []; - for (var i = 0; i < dataitems.length; i++) { - var subDict = dataitems[i]; - var key = subDict["key"]; - if (key == "TotalTime") { - this._totalTime = subDict["value"]; - continue; - } - if (key == "componentName") { - this._comName = subDict["value"]; - continue; - } - if (key == "AnimationName") { - this._aniName = subDict["value"]; - continue; - } - if (key == "ActionType") { - this._state = subDict["value"]; - } - } - }, - - removeAll: function () { - if (this._armature) { - ccs.triggerManager.removeArmatureMovementCallBack(this._armature, this.animationEvent, this); - } - }, - - animationEvent: function (armature, movementType, movementID) { - if (movementType == this._state && movementID == this._aniName) { - this._success = true; - } - } -}); -var NodeInRect = ccs.BaseTriggerCondition.extend({ - _tag: -1, - _origin: null, - _size: null, - ctor: function () { - this._tag = -1; - this._origin = null; - this._size = null; - this._origin = cc.p(0, 0); - this._size = cc.p(0, 0); - }, - - init: function () { - - return true; - }, - - detect: function () { - var node = ccs.sceneReader.getNodeByTag(this._tag); - if (node && Math.abs(node.x - this._origin.x) <= this._size.width && Math.abs(node.y - this._origin.y) <= this._size.height) { - return true; - } - return false; - }, - serialize: function (jsonVal) { - var dataitems = jsonVal["dataitems"] || []; - for (var i = 0; i < dataitems.length; i++) { - var subDict = dataitems[i]; - var key = subDict["key"]; - if (key == "Tag") { - this._tag = subDict["value"]; - continue; - } - if (key == "originX") { - this._origin.x = subDict["value"]; - continue; - } - if (key == "originY") { - this._origin.y = subDict["value"]; - continue; - } - if (key == "originX") { - this._origin.x = subDict["value"]; - continue; - } - if (key == "originY") { - this._origin.y = subDict["value"]; - continue; - } - if (key == "sizeWidth") { - this._size.width = subDict["value"]; - continue; - } - if (key == "sizeHeight") { - this._size.height = subDict["value"]; - } - } - }, - - removeAll: function () { - - } -}); - -var NodeVisible = ccs.BaseTriggerCondition.extend({ - _tag: -1, - _visible: false, - cotr: function () { - this._tag = -1; - this._visible = false; - }, - - init: function () { - return true; - }, - - detect: function () { - var node = ccs.sceneReader.getNodeByTag(this._tag); - if (node && node.visible == this._visible) { - return true; - } - return false; - }, - serialize: function (jsonVal) { - var dataitems = jsonVal["dataitems"] || []; - for (var i = 0; i < dataitems.length; i++) { - var subDict = dataitems[i]; - var key = subDict["key"]; - if (key == "Tag") { - this._tag = subDict["value"]; - continue; - } - if (key == "Visible") { - this._visible = subDict["value"]; - } - } - }, - - removeAll: function () { - - } -}); - - -ccs.registerTriggerClass("TimeElapsed", TimeElapsed); -ccs.registerTriggerClass("ArmatureActionState", ArmatureActionState); -ccs.registerTriggerClass("NodeInRect", NodeInRect); -ccs.registerTriggerClass("NodeVisible", NodeVisible); \ No newline at end of file diff --git a/tests/js-tests/src/CocoStudioTest/SceneTest/TriggerCode/EventDef.js b/tests/js-tests/src/CocoStudioTest/SceneTest/TriggerCode/EventDef.js deleted file mode 100644 index f9bc131a73..0000000000 --- a/tests/js-tests/src/CocoStudioTest/SceneTest/TriggerCode/EventDef.js +++ /dev/null @@ -1,33 +0,0 @@ -/**************************************************************************** - Copyright (c) 2008-2010 Ricardo Quesada - Copyright (c) 2011-2012 cocos2d-x.org - Copyright (c) 2013-2014 Chukong Technologies Inc. - - http://www.cocos2d-x.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - ****************************************************************************/ -var TRIGGER_EVENT_ENTERSCENE = 0; -var TRIGGER_EVENT_LEAVESCENE = 1; -var TRIGGER_EVENT_INITSCENE = 2; -var TRIGGER_EVENT_UPDATESCENE = 3; -var TRIGGER_EVENT_TOUCHBEGAN = 4; -var TRIGGER_EVENT_TOUCHMOVED = 5; -var TRIGGER_EVENT_TOUCHENDED = 6; -var TRIGGER_EVENT_TOUCHCANCELLED = 7; \ No newline at end of file diff --git a/tests/js-tests/src/GUITest/UIScene.js b/tests/js-tests/src/GUITest/UIScene.js index 75bf04b55f..b0b23831da 100644 --- a/tests/js-tests/src/GUITest/UIScene.js +++ b/tests/js-tests/src/GUITest/UIScene.js @@ -51,14 +51,8 @@ var UIMainLayer = cc.Layer.extend({ this.addChild(mainNode); var widget; - if(cocoStudioOldApiFlag == 0){ - var json = ccs.load("ccs-res/cocosui/UITest/UITest.json"); - widget = json.node; - } - else{ - //old api - widget = ccs.uiReader.widgetFromJsonFile("ccs-res/cocosui/UITest/UITest.json"); - } + var json = ccs.load("ccs-res/cocosui/UITest/UITest.json"); + widget = json.node; mainNode.addChild(widget,-1); this._sceneTitle = widget.getChildByName("UItest"); diff --git a/tests/js-tests/src/tests-main.js b/tests/js-tests/src/tests-main.js index 168696ec99..83a0447bc7 100644 --- a/tests/js-tests/src/tests-main.js +++ b/tests/js-tests/src/tests-main.js @@ -312,15 +312,6 @@ var testNames = [ return new CocosDenshionTestScene(); } }, - { - title:"CocoStudio Test", - resource:g_cocoStudio, - platforms: PLATFORM_ALL, - linksrc:"", - testScene:function () { - return new CocoStudioTestScene(); - } - }, { title:"Component Test", platforms: PLATFORM_JSB, diff --git a/tests/js-tests/src/tests_resources.js b/tests/js-tests/src/tests_resources.js index 2cca6ad7f2..c4683fe442 100644 --- a/tests/js-tests/src/tests_resources.js +++ b/tests/js-tests/src/tests_resources.js @@ -75,41 +75,6 @@ var s_tcc_issue_2 = "animations/tcc_issue_2.png"; var s_tcc_issue_1_plist = "animations/tcc_issue_1.plist"; var s_tcc_issue_2_plist = "animations/tcc_issue_2.plist"; -var s_Cowboy_json = "ccs-res/armature/Cowboy.ExportJson"; -var s_Cowboy_plist = "ccs-res/armature/Cowboy0.plist"; -var s_Cowboy_png = "ccs-res/armature/Cowboy0.png"; -var s_hero_json = "ccs-res/armature/hero.ExportJson"; -var s_hero0_plist = "ccs-res/armature/hero0.plist"; -var s_hero0_png = "ccs-res/armature/hero0.png"; -var s_horse_json = "ccs-res/armature/horse.ExportJson"; -var s_horse0_plist = "ccs-res/armature/horse0.plist"; -var s_horse0_png = "ccs-res/armature/horse0.png"; -var s_bear_json = "ccs-res/armature/bear.ExportJson"; -var s_bear0_plist = "ccs-res/armature/bear0.plist"; -var s_bear0_png = "ccs-res/armature/bear0.png"; -var s_blood_plist = "ccs-res/armature/blood.plist"; -var s_HeroAnimation_json = "ccs-res/armature/HeroAnimation.ExportJson"; -var s_HeroAnimation0_plist = "ccs-res/armature/HeroAnimation0.plist"; -var s_HeroAnimation0_png = "ccs-res/armature/HeroAnimation0.png"; -var s_cyborg_plist = "ccs-res/armature/cyborg.plist"; -var s_cyborg_png = "ccs-res/armature/cyborg.png"; -var s_cyborg_xml = "ccs-res/armature/cyborg.xml"; -var s_Dragon_plist = "ccs-res/armature/Dragon.plist"; -var s_Dragon_png = "ccs-res/armature/Dragon.png"; -var s_Dragon_xml = "ccs-res/armature/Dragon.xml"; -var s_knight_plist = "ccs-res/armature/knight.plist"; -var s_knight_png = "ccs-res/armature/knight.png"; -var s_knight_xml = "ccs-res/armature/knight.xml"; -var s_robot_plist = "ccs-res/armature/robot.plist"; -var s_robot_png = "ccs-res/armature/robot.png"; -var s_robot_xml = "ccs-res/armature/robot.xml"; -var s_weapon_plist = "ccs-res/armature/weapon.plist"; -var s_weapon_png = "ccs-res/armature/weapon.png"; -var s_weapon_xml = "ccs-res/armature/weapon.xml"; -var s_testEasing_json = "ccs-res/armature/testEasing.ExportJson"; -var s_testEasing0_plist = "ccs-res/armature/testEasing0.plist"; -var s_testEasing0_png = "ccs-res/armature/testEasing0.png"; - // Issue CustomIssueAnimationsWithOnlyOneFrame var s_testIssueAnimationsWithOnlyOneFrame_json = "ccs-res/cocosui/CustomIssueAnimationsWithOnlyOneFrame/AnimationsWithOnlyOneFrame.json"; var s_testIssueAnimationsWithOnlyOneFrame_png = "ccs-res/cocosui/CustomIssueAnimationsWithOnlyOneFrame/TheDigitalSpell.png"; @@ -563,366 +528,6 @@ var g_extensions = [ ccbjs + "ccb/animated-grossini.plist" ]; -var g_cocoStudio = [ - //Armature - s_Cowboy_json , - s_Cowboy_plist, - s_Cowboy_png, - s_hero_json, - s_hero0_plist, - s_hero0_png, - s_horse_json, - s_horse0_plist, - s_horse0_png, - s_bear_json, - s_bear0_plist, - s_bear0_png, - s_blood_plist, - s_HeroAnimation_json, - s_HeroAnimation0_plist, - s_HeroAnimation0_png, - s_cyborg_plist , - s_cyborg_png , - s_cyborg_xml , - s_Dragon_plist , - s_Dragon_png , - s_Dragon_xml , - s_knight_plist , - s_knight_png , - s_knight_xml , - s_robot_plist , - s_robot_png , - s_robot_xml , - s_weapon_plist , - s_weapon_png , - s_weapon_xml , - s_testEasing_json , - s_testEasing0_plist , - s_testEasing0_png , - // Issue CustomIssueAnimationsWithOnlyOneFrame - s_testIssueAnimationsWithOnlyOneFrame_json , - s_testIssueAnimationsWithOnlyOneFrame_png , - -//GUI - "Particles/SmallSun.plist", - "Images/b1.png", - "Images/b2.png", - "Images/f1.png", - "Images/f2.png", - "ccs-res/cocosui/UIEditorTest/UIButton/background.png", - "ccs-res/cocosui/UIEditorTest/UIButton/buttonBackground.png", - "ccs-res/cocosui/UIEditorTest/UIButton/buttonHighlighted.png", - "ccs-res/cocosui/UIEditorTest/UIButton/button_n.png", - "ccs-res/cocosui/UIEditorTest/UIButton/button_p.png", - "ccs-res/cocosui/UIEditorTest/UIButton/ribbon.png", - "ccs-res/cocosui/UIEditorTest/UIButton/Button_1.json", - "ccs-res/cocosui/UIEditorTest/UICheckBox/background.png", - "ccs-res/cocosui/UIEditorTest/UICheckBox/buttonBackground.png", - "ccs-res/cocosui/UIEditorTest/UICheckBox/ribbon.png", - "ccs-res/cocosui/UIEditorTest/UICheckBox/selected01.png", - "ccs-res/cocosui/UIEditorTest/UICheckBox/selected02.png", - "ccs-res/cocosui/UIEditorTest/UICheckBox/checkbox_1.json", - "ccs-res/cocosui/UIEditorTest/UICheckBox/MainScene.json", - "ccs-res/cocosui/UIEditorTest/UICheckBox/Default/CheckBox_Disable.png", - "ccs-res/cocosui/UIEditorTest/UICheckBox/img/btn_music.png", - "ccs-res/cocosui/UIEditorTest/UICheckBox/img/btn_sound_off.png", - "ccs-res/cocosui/UIEditorTest/UIImageView/background.png", - "ccs-res/cocosui/UIEditorTest/UIImageView/buttonBackground.png", - "ccs-res/cocosui/UIEditorTest/UIImageView/buttonHighlighted.png", - "ccs-res/cocosui/UIEditorTest/UIImageView/GUI/image.png", - "ccs-res/cocosui/UIEditorTest/UIImageView/ribbon.png", - "ccs-res/cocosui/UIEditorTest/UIImageView/ImageView_1.json", - "ccs-res/cocosui/UIEditorTest/UILabelAtlas/background.png", - "ccs-res/cocosui/UIEditorTest/UILabelAtlas/buttonBackground.png", - "ccs-res/cocosui/UIEditorTest/UILabelAtlas/GUI/labelatlasimg.png", - "ccs-res/cocosui/UIEditorTest/UILabelAtlas/ribbon.png", - "ccs-res/cocosui/UIEditorTest/UILabelAtlas/labelatlas_1.json", - "ccs-res/cocosui/UIEditorTest/UILabelBMFont/background.png", - "ccs-res/cocosui/UIEditorTest/UILabelBMFont/buttonBackground.png", - "ccs-res/cocosui/UIEditorTest/UILabelBMFont/GUI/missing-font.fnt", - "ccs-res/cocosui/UIEditorTest/UILabelBMFont/GUI/missing-font.png", - "ccs-res/cocosui/UIEditorTest/UILabelBMFont/ribbon.png", - "ccs-res/cocosui/UIEditorTest/UILabelBMFont/labelbmfont_1.json", - "ccs-res/cocosui/UIEditorTest/UILabel/background.png", - "ccs-res/cocosui/UIEditorTest/UILabel/buttonBackground.png", - "ccs-res/cocosui/UIEditorTest/UILabel/ribbon.png", - "ccs-res/cocosui/UIEditorTest/UILabel/label_1.json", - "ccs-res/cocosui/UIEditorTest/UILayout/BackgroundImage/background.png", - "ccs-res/cocosui/UIEditorTest/UILayout/BackgroundImage/buttonBackground.png", - "ccs-res/cocosui/UIEditorTest/UILayout/BackgroundImage/button_n.png", - "ccs-res/cocosui/UIEditorTest/UILayout/BackgroundImage/button_p.png", - "ccs-res/cocosui/UIEditorTest/UILayout/BackgroundImage/GUI/image.png", - "ccs-res/cocosui/UIEditorTest/UILayout/BackgroundImage/Hello.png", - "ccs-res/cocosui/UIEditorTest/UILayout/BackgroundImage/ribbon.png", - "ccs-res/cocosui/UIEditorTest/UILayout/BackgroundImage/selected01.png", - "ccs-res/cocosui/UIEditorTest/UILayout/BackgroundImage/selected02.png", - "ccs-res/cocosui/UIEditorTest/UILayout/BackgroundImage/backgroundimage_1.json", - "ccs-res/cocosui/UIEditorTest/UILayout/Color/background.png", - "ccs-res/cocosui/UIEditorTest/UILayout/Color/buttonBackground.png", - "ccs-res/cocosui/UIEditorTest/UILayout/Color/button_n.png", - "ccs-res/cocosui/UIEditorTest/UILayout/Color/button_p.png", - "ccs-res/cocosui/UIEditorTest/UILayout/Color/GUI/image.png", - "ccs-res/cocosui/UIEditorTest/UILayout/Color/ribbon.png", - "ccs-res/cocosui/UIEditorTest/UILayout/Color/selected01.png", - "ccs-res/cocosui/UIEditorTest/UILayout/Color/selected02.png", - "ccs-res/cocosui/UIEditorTest/UILayout/Color/color_1.json", - "ccs-res/cocosui/UIEditorTest/UILayout/Layout/background.png", - "ccs-res/cocosui/UIEditorTest/UILayout/Layout/buttonBackground.png", - "ccs-res/cocosui/UIEditorTest/UILayout/Layout/button_n.png", - "ccs-res/cocosui/UIEditorTest/UILayout/Layout/button_p.png", - "ccs-res/cocosui/UIEditorTest/UILayout/Layout/GUI/image.png", - "ccs-res/cocosui/UIEditorTest/UILayout/Layout/ribbon.png", - "ccs-res/cocosui/UIEditorTest/UILayout/Layout/selected01.png", - "ccs-res/cocosui/UIEditorTest/UILayout/Layout/selected02.png", - "ccs-res/cocosui/UIEditorTest/UILayout/Layout/layout_1.json", - "ccs-res/cocosui/UIEditorTest/UILayout/Gradient_Color/background.png", - "ccs-res/cocosui/UIEditorTest/UILayout/Gradient_Color/buttonBackground.png", - "ccs-res/cocosui/UIEditorTest/UILayout/Gradient_Color/button_n.png", - "ccs-res/cocosui/UIEditorTest/UILayout/Gradient_Color/button_p.png", - "ccs-res/cocosui/UIEditorTest/UILayout/Gradient_Color/GUI/image.png", - "ccs-res/cocosui/UIEditorTest/UILayout/Gradient_Color/ribbon.png", - "ccs-res/cocosui/UIEditorTest/UILayout/Gradient_Color/selected01.png", - "ccs-res/cocosui/UIEditorTest/UILayout/Gradient_Color/selected02.png", - "ccs-res/cocosui/UIEditorTest/UILayout/Gradient_Color/gradient_color_1.json", - "ccs-res/cocosui/UIEditorTest/UILayout/Linear_Horizontal_Layout/background.png", - "ccs-res/cocosui/UIEditorTest/UILayout/Linear_Horizontal_Layout/buttonBackground.png", - "ccs-res/cocosui/UIEditorTest/UILayout/Linear_Horizontal_Layout/button_n.png", - "ccs-res/cocosui/UIEditorTest/UILayout/Linear_Horizontal_Layout/button_p.png", - "ccs-res/cocosui/UIEditorTest/UILayout/Linear_Horizontal_Layout/GUI/image.png", - "ccs-res/cocosui/UIEditorTest/UILayout/Linear_Horizontal_Layout/ribbon.png", - "ccs-res/cocosui/UIEditorTest/UILayout/Linear_Horizontal_Layout/selected01.png", - "ccs-res/cocosui/UIEditorTest/UILayout/Linear_Horizontal_Layout/selected02.png", - "ccs-res/cocosui/UIEditorTest/UILayout/Linear_Horizontal_Layout/linear_horizontal.json", - "ccs-res/cocosui/UIEditorTest/UILayout/Linear_Vertical_Layout/background.png", - "ccs-res/cocosui/UIEditorTest/UILayout/Linear_Vertical_Layout/buttonBackground.png", - "ccs-res/cocosui/UIEditorTest/UILayout/Linear_Vertical_Layout/button_n.png", - "ccs-res/cocosui/UIEditorTest/UILayout/Linear_Vertical_Layout/button_p.png", - "ccs-res/cocosui/UIEditorTest/UILayout/Linear_Vertical_Layout/GUI/image.png", - "ccs-res/cocosui/UIEditorTest/UILayout/Linear_Vertical_Layout/ribbon.png", - "ccs-res/cocosui/UIEditorTest/UILayout/Linear_Vertical_Layout/selected01.png", - "ccs-res/cocosui/UIEditorTest/UILayout/Linear_Vertical_Layout/selected02.png", - "ccs-res/cocosui/UIEditorTest/UILayout/Linear_Vertical_Layout/linear_vertical.json", - "ccs-res/cocosui/UIEditorTest/UILayout/Relative_Align_Location/background.png", - "ccs-res/cocosui/UIEditorTest/UILayout/Relative_Align_Location/buttonBackground.png", - "ccs-res/cocosui/UIEditorTest/UILayout/Relative_Align_Location/button_n.png", - "ccs-res/cocosui/UIEditorTest/UILayout/Relative_Align_Location/button_p.png", - "ccs-res/cocosui/UIEditorTest/UILayout/Relative_Align_Location/GUI/image.png", - "ccs-res/cocosui/UIEditorTest/UILayout/Relative_Align_Location/ribbon.png", - "ccs-res/cocosui/UIEditorTest/UILayout/Relative_Align_Location/selected01.png", - "ccs-res/cocosui/UIEditorTest/UILayout/Relative_Align_Location/selected02.png", - "ccs-res/cocosui/UIEditorTest/UILayout/Relative_Align_Location/relative_align_location.json", - "ccs-res/cocosui/UIEditorTest/UILayout/Relative_Align_Parent/background.png", - "ccs-res/cocosui/UIEditorTest/UILayout/Relative_Align_Parent/buttonBackground.png", - "ccs-res/cocosui/UIEditorTest/UILayout/Relative_Align_Parent/button_n.png", - "ccs-res/cocosui/UIEditorTest/UILayout/Relative_Align_Parent/button_p.png", - "ccs-res/cocosui/UIEditorTest/UILayout/Relative_Align_Parent/GUI/image.png", - "ccs-res/cocosui/UIEditorTest/UILayout/Relative_Align_Parent/ribbon.png", - "ccs-res/cocosui/UIEditorTest/UILayout/Relative_Align_Parent/selected01.png", - "ccs-res/cocosui/UIEditorTest/UILayout/Relative_Align_Parent/selected02.png", - "ccs-res/cocosui/UIEditorTest/UILayout/Relative_Align_Parent/relative_align_parent.json", - "ccs-res/cocosui/UIEditorTest/UILayout/Scale9_BackgroundImage/background.png", - "ccs-res/cocosui/UIEditorTest/UILayout/Scale9_BackgroundImage/buttonBackground.png", - "ccs-res/cocosui/UIEditorTest/UILayout/Scale9_BackgroundImage/button_n.png", - "ccs-res/cocosui/UIEditorTest/UILayout/Scale9_BackgroundImage/button_p.png", - "ccs-res/cocosui/UIEditorTest/UILayout/Scale9_BackgroundImage/GUI/image.png", - "ccs-res/cocosui/UIEditorTest/UILayout/Scale9_BackgroundImage/ribbon.png", - "ccs-res/cocosui/UIEditorTest/UILayout/Scale9_BackgroundImage/selected01.png", - "ccs-res/cocosui/UIEditorTest/UILayout/Scale9_BackgroundImage/selected02.png", - "ccs-res/cocosui/UIEditorTest/UILayout/Scale9_BackgroundImage/slider_bar.png", - "ccs-res/cocosui/UIEditorTest/UILayout/Scale9_BackgroundImage/scale9.json", - "ccs-res/cocosui/UIEditorTest/UIListView/Horizontal/background.png", - "ccs-res/cocosui/UIEditorTest/UIListView/Horizontal/buttonBackground.png", - "ccs-res/cocosui/UIEditorTest/UIListView/Horizontal/button_p.png", - "ccs-res/cocosui/UIEditorTest/UIListView/Horizontal/GUI/button.png", - "ccs-res/cocosui/UIEditorTest/UIListView/Horizontal/GUI/image.png", - "ccs-res/cocosui/UIEditorTest/UIListView/Horizontal/ribbon.png", - "ccs-res/cocosui/UIEditorTest/UIListView/Horizontal/horizontal_1.json", - "ccs-res/cocosui/UIEditorTest/UIListView/Vertical/background.png", - "ccs-res/cocosui/UIEditorTest/UIListView/Vertical/buttonBackground.png", - "ccs-res/cocosui/UIEditorTest/UIListView/Vertical/button_p.png", - "ccs-res/cocosui/UIEditorTest/UIListView/Vertical/GUI/button.png", - "ccs-res/cocosui/UIEditorTest/UIListView/Vertical/GUI/image.png", - "ccs-res/cocosui/UIEditorTest/UIListView/Vertical/ribbon.png", - "ccs-res/cocosui/UIEditorTest/UIListView/Vertical/vertical_1.json", - "ccs-res/cocosui/UIEditorTest/UILoadingBar/background.png", - "ccs-res/cocosui/UIEditorTest/UILoadingBar/buttonBackground.png", - "ccs-res/cocosui/UIEditorTest/UILoadingBar/GUI/loadingbar.png", - "ccs-res/cocosui/UIEditorTest/UILoadingBar/ribbon.png", - "ccs-res/cocosui/UIEditorTest/UILoadingBar/loadingbar_1.json", - "ccs-res/cocosui/UIEditorTest/UIPageView/background.png", - "ccs-res/cocosui/UIEditorTest/UIPageView/buttonBackground.png", - "ccs-res/cocosui/UIEditorTest/UIPageView/button_n.png", - "ccs-res/cocosui/UIEditorTest/UIPageView/ribbon.png", - "ccs-res/cocosui/UIEditorTest/UIPageView/pageview_1.json", - "ccs-res/cocosui/UIEditorTest/UIScrollView/Both/background.png", - "ccs-res/cocosui/UIEditorTest/UIScrollView/Both/buttonBackground.png", - "ccs-res/cocosui/UIEditorTest/UIScrollView/Both/button_n.png", - "ccs-res/cocosui/UIEditorTest/UIScrollView/Both/button_p.png", - "ccs-res/cocosui/UIEditorTest/UIScrollView/Both/GUI/image.png", - "ccs-res/cocosui/UIEditorTest/UIScrollView/Both/ribbon.png", - "ccs-res/cocosui/UIEditorTest/UIScrollView/Both/selected01.png", - "ccs-res/cocosui/UIEditorTest/UIScrollView/Both/selected02.png", - "ccs-res/cocosui/UIEditorTest/UIScrollView/Both/both_1.json", - "ccs-res/cocosui/UIEditorTest/UIScrollView/Horizontal/background.png", - "ccs-res/cocosui/UIEditorTest/UIScrollView/Horizontal/buttonBackground.png", - "ccs-res/cocosui/UIEditorTest/UIScrollView/Horizontal/button_n.png", - "ccs-res/cocosui/UIEditorTest/UIScrollView/Horizontal/button_p.png", - "ccs-res/cocosui/UIEditorTest/UIScrollView/Horizontal/GUI/image.png", - "ccs-res/cocosui/UIEditorTest/UIScrollView/Horizontal/ribbon.png", - "ccs-res/cocosui/UIEditorTest/UIScrollView/Horizontal/selected01.png", - "ccs-res/cocosui/UIEditorTest/UIScrollView/Horizontal/selected02.png", - "ccs-res/cocosui/UIEditorTest/UIScrollView/Horizontal/horizontal_1.json", - "ccs-res/cocosui/UIEditorTest/UIScrollView/Vertical/background.png", - "ccs-res/cocosui/UIEditorTest/UIScrollView/Vertical/buttonBackground.png", - "ccs-res/cocosui/UIEditorTest/UIScrollView/Vertical/button_n.png", - "ccs-res/cocosui/UIEditorTest/UIScrollView/Vertical/button_p.png", - "ccs-res/cocosui/UIEditorTest/UIScrollView/Vertical/GUI/image.png", - "ccs-res/cocosui/UIEditorTest/UIScrollView/Vertical/ribbon.png", - "ccs-res/cocosui/UIEditorTest/UIScrollView/Vertical/selected01.png", - "ccs-res/cocosui/UIEditorTest/UIScrollView/Vertical/selected02.png", - "ccs-res/cocosui/UIEditorTest/UIScrollView/Vertical/vertical_1.json", - "ccs-res/cocosui/UIEditorTest/UISlider/background.png", - "ccs-res/cocosui/UIEditorTest/UISlider/buttonBackground.png", - "ccs-res/cocosui/UIEditorTest/UISlider/ribbon.png", - "ccs-res/cocosui/UIEditorTest/UISlider/silder_progressBar.png", - "ccs-res/cocosui/UIEditorTest/UISlider/slider_bar.png", - "ccs-res/cocosui/UIEditorTest/UISlider/slider_bar_button.png", - "ccs-res/cocosui/UIEditorTest/UISlider/slider_1.json", - "ccs-res/cocosui/UIEditorTest/UITextField/background.png", - "ccs-res/cocosui/UIEditorTest/UITextField/buttonBackground.png", - "ccs-res/cocosui/UIEditorTest/UITextField/ribbon.png", - "ccs-res/cocosui/UIEditorTest/UITextField/textfield_1.json", - "ccs-res/cocosui/UIEditorTest/UIWidgetAddNode/background.png", - "ccs-res/cocosui/UIEditorTest/UIWidgetAddNode/buttonBackground.png", - "ccs-res/cocosui/UIEditorTest/UIWidgetAddNode/ribbon.png", - "ccs-res/cocosui/UIEditorTest/UIWidgetAddNode/widget_add_node.json", - "background-music-aac.wav", - "pew-pew-lei.wav", - //Components - "components/Player.png", - "components/Projectile.png", - "components/Target.png", - //Scene - "ccs-res/scenetest/ArmatureComponentTest/ArmatureComponentTest.json", - "ccs-res/scenetest/ArmatureComponentTest/fishes/blowFish/Blowfish.ExportJson", - "ccs-res/scenetest/ArmatureComponentTest/fishes/blowFish/Blowfish0.plist", - "ccs-res/scenetest/ArmatureComponentTest/fishes/blowFish/Blowfish0.png", - "ccs-res/scenetest/ArmatureComponentTest/fishes/Butterflyfish/Butterflyfish.ExportJson", - "ccs-res/scenetest/ArmatureComponentTest/fishes/Butterflyfish/Butterflyfish0.plist", - "ccs-res/scenetest/ArmatureComponentTest/fishes/Butterflyfish/Butterflyfish0.png", - "ccs-res/scenetest/ArmatureComponentTest/Images/startMenuBG.png", - "ccs-res/scenetest/AttributeComponentTest/AttributeComponentTest.json", - "ccs-res/scenetest/AttributeComponentTest/grossinis_sister1.png", - "ccs-res/scenetest/AttributeComponentTest/grossinis_sister2.png", - "ccs-res/scenetest/AttributeComponentTest/PlayerAttribute.json", - "ccs-res/scenetest/BackgroundComponentTest/BackgroundComponentTest.json", - "ccs-res/scenetest/BackgroundComponentTest/Images/startMenuBG.png", - "ccs-res/scenetest/BackgroundComponentTest/Misc/music_logo.mp3", - "ccs-res/scenetest/BackgroundComponentTest/Misc/music_logo.wav", - "ccs-res/scenetest/BackgroundComponentTest/Particles/qipao01.plist", - "ccs-res/scenetest/BackgroundComponentTest/Particles/qipao01.png", - "ccs-res/scenetest/BackgroundComponentTest/startMenu/Fish_UI/starMenuButton01.png", - "ccs-res/scenetest/BackgroundComponentTest/startMenu/Fish_UI/starMenuButton02.png", - "ccs-res/scenetest/BackgroundComponentTest/startMenu/Fish_UI/ui_logo_001-hd.png", - "ccs-res/scenetest/BackgroundComponentTest/startMenu/startMenu_1.json", - "ccs-res/scenetest/EffectComponentTest/CowBoy/Cowboy.ExportJson", - "ccs-res/scenetest/EffectComponentTest/CowBoy/Cowboy0.plist", - "ccs-res/scenetest/EffectComponentTest/CowBoy/Cowboy0.png", - "ccs-res/scenetest/EffectComponentTest/EffectComponentTest.json", - "ccs-res/scenetest/EffectComponentTest/pew-pew-lei.wav", - "ccs-res/scenetest/LoadSceneEdtiorFileTest/fishes/blowFish/Blowfish.ExportJson", - "ccs-res/scenetest/LoadSceneEdtiorFileTest/fishes/blowFish/Blowfish0.plist", - "ccs-res/scenetest/LoadSceneEdtiorFileTest/fishes/blowFish/Blowfish0.png", - "ccs-res/scenetest/LoadSceneEdtiorFileTest/fishes/Butterflyfish/Butterflyfish.ExportJson", - "ccs-res/scenetest/LoadSceneEdtiorFileTest/fishes/Butterflyfish/Butterflyfish0.plist", - "ccs-res/scenetest/LoadSceneEdtiorFileTest/fishes/Butterflyfish/Butterflyfish0.png", - "ccs-res/scenetest/LoadSceneEdtiorFileTest/FishJoy2.json", - "ccs-res/scenetest/LoadSceneEdtiorFileTest/Images/startMenuBG.png", - "ccs-res/scenetest/LoadSceneEdtiorFileTest/Misc/music_logo.mp3", - "ccs-res/scenetest/LoadSceneEdtiorFileTest/Misc/music_logo.wav", - "ccs-res/scenetest/LoadSceneEdtiorFileTest/Particles/qipao01.plist", - "ccs-res/scenetest/LoadSceneEdtiorFileTest/Particles/qipao01.png", - "ccs-res/scenetest/LoadSceneEdtiorFileTest/startMenu/Fish_UI/starMenuButton01.png", - "ccs-res/scenetest/LoadSceneEdtiorFileTest/startMenu/Fish_UI/starMenuButton02.png", - "ccs-res/scenetest/LoadSceneEdtiorFileTest/startMenu/Fish_UI/ui_logo_001-hd.png", - "ccs-res/scenetest/LoadSceneEdtiorFileTest/startMenu/startMenu_1.json", - "ccs-res/scenetest/ParticleComponentTest/ParticleComponentTest.json", - "ccs-res/scenetest/ParticleComponentTest/SmallSun.plist", - "ccs-res/scenetest/ParticleComponentTest/Upsidedown.plist", - "ccs-res/scenetest/SpriteComponentTest/grossinis_sister1.png", - "ccs-res/scenetest/SpriteComponentTest/grossinis_sister2.png", - "ccs-res/scenetest/SpriteComponentTest/SpriteComponentTest.json", - "ccs-res/scenetest/TmxMapComponentTest/iso-test.png", - "ccs-res/scenetest/TmxMapComponentTest/iso-test.tmx", - "ccs-res/scenetest/TmxMapComponentTest/TmxMapComponentTest.json", - "ccs-res/scenetest/TriggerTest/fishes/blowFish/Blowfish.ExportJson", - "ccs-res/scenetest/TriggerTest/fishes/blowFish/Blowfish0.plist", - "ccs-res/scenetest/TriggerTest/fishes/blowFish/Blowfish0.png", - "ccs-res/scenetest/TriggerTest/fishes/Butterflyfish/Butterflyfish.ExportJson", - "ccs-res/scenetest/TriggerTest/fishes/Butterflyfish/Butterflyfish0.plist", - "ccs-res/scenetest/TriggerTest/fishes/Butterflyfish/Butterflyfish0.png", - "ccs-res/scenetest/TriggerTest/Images/startMenuBG.png", - "ccs-res/scenetest/TriggerTest/TriggerTest.json", - "ccs-res/scenetest/UIComponentTest/fishes/blowFish/Blowfish.ExportJson", - "ccs-res/scenetest/UIComponentTest/fishes/blowFish/Blowfish0.plist", - "ccs-res/scenetest/UIComponentTest/fishes/blowFish/Blowfish0.png", - "ccs-res/scenetest/UIComponentTest/fishes/Butterflyfish/Butterflyfish.ExportJson", - "ccs-res/scenetest/UIComponentTest/fishes/Butterflyfish/Butterflyfish0.plist", - "ccs-res/scenetest/UIComponentTest/fishes/Butterflyfish/Butterflyfish0.png", - "ccs-res/scenetest/UIComponentTest/Images/startMenuBG.png", - "ccs-res/scenetest/UIComponentTest/starMenuButton/starMenuButton.ExportJson", - "ccs-res/scenetest/UIComponentTest/starMenuButton/starMenuButton0.plist", - "ccs-res/scenetest/UIComponentTest/starMenuButton/starMenuButton0.png", - "ccs-res/scenetest/UIComponentTest/UIComponentTest.json", - - //parser - "ccs-res/cocosui/UIEditorTest/cocostudio1_3/CocostudioV1_3_1.ExportJson", - "ccs-res/cocosui/UIEditorTest/cocostudio1_3/CocostudioV1_30.plist", - "ccs-res/cocosui/UIEditorTest/cocostudio1_3/CocostudioV1_30.png", - "ccs-res/cocosui/UIEditorTest/cocostudio1_3/SmallSun.plist", - "ccs-res/cocosui/UIEditorTest/cocostudio1_3/GUI/labelatlasimg.png", - "ccs-res/cocosui/UIEditorTest/cocostudio1_3/GUI/missing-font.fnt", - "ccs-res/cocosui/UIEditorTest/cocostudio1_3/GUI/missing-font.png", - "ccs-res/cocosui/UIEditorTest/cocostudio1_4/Cocostudio1_4_1.ExportJson", - "ccs-res/cocosui/UIEditorTest/cocostudio1_4/Cocostudio1_40.plist", - "ccs-res/cocosui/UIEditorTest/cocostudio1_4/Cocostudio1_40.png", - "ccs-res/cocosui/UIEditorTest/cocostudio1_4/SmallSun.plist", - "ccs-res/cocosui/UIEditorTest/cocostudio1_4/GUI/labelatlasimg.png", - "ccs-res/cocosui/UIEditorTest/cocostudio1_4/GUI/missing-font.fnt", - "ccs-res/cocosui/UIEditorTest/cocostudio1_4/GUI/missing-font.png", - "ccs-res/cocosui/UIEditorTest/cocostudio1_5/Cocostudio1_5_1.ExportJson", - "ccs-res/cocosui/UIEditorTest/cocostudio1_5/Cocostudio1_50.plist", - "ccs-res/cocosui/UIEditorTest/cocostudio1_5/Cocostudio1_50.png", - "ccs-res/cocosui/UIEditorTest/cocostudio1_5/SmallSun.plist", - "ccs-res/cocosui/UIEditorTest/cocostudio1_5/GUI/labelatlasimg.png", - "ccs-res/cocosui/UIEditorTest/cocostudio1_5/GUI/missing-font.fnt", - "ccs-res/cocosui/UIEditorTest/cocostudio1_5/GUI/missing-font.png", - - "ccs-res/cocosui/UIEditorTest/2.1/MainScene.json", - "ccs-res/cocosui/UIEditorTest/2.1/plist1/Plist.plist", - "ccs-res/cocosui/UIEditorTest/2.1/Plist/ui.plist", - "ccs-res/cocosui/UIEditorTest/2.1/LoadingBar/pipe2.png", - "ccs-res/cocosui/UIEditorTest/2.1/particle/blue.plist", - "ccs-res/cocosui/UIEditorTest/2.1/Default/Slider_Back.png", - "ccs-res/cocosui/UIEditorTest/2.1/Default/SliderNode_Normal.png", - "ccs-res/cocosui/UIEditorTest/2.1/Default/SliderNode_Press.png", - "ccs-res/cocosui/UIEditorTest/2.1/Default/SliderNode_Disable.png", - "ccs-res/cocosui/UIEditorTest/2.1/Default/Slider_PressBar.png", - "ccs-res/cocosui/UIEditorTest/2.1/Default/defaultParticle.plist", - "ccs-res/cocosui/UIEditorTest/2.1/Default/TextAtlas.png", - "ccs-res/cocosui/UIEditorTest/2.1/fonts_weapon_001-hd.png", - "ccs-res/cocosui/UIEditorTest/2.1/FNT/futura.fnt", - "ccs-res/cocosui/UIEditorTest/2.1/Default/defaultBMFont.fnt", - "ccs-res/cocosui/UIEditorTest/2.1/FNT/Heiti18.fnt", - - "Particles/BoilingFoam.plist", - "ccs-res/cocosui/CustomImageViewTest/NewProject_2_1.ExportJson", - "ccs-res/cocosui/CustomImageViewTest/NewProject_20.plist", - "ccs-res/cocosui/CustomImageViewTest/NewProject_20.png", - - "ActionTimeline/DemoPlayer_skeleton.json" -]; - var g_ui = [ "ccs-res/cocosui/switch-mask.png", "ccs-res/cocosui/animationbuttonnormal.png", @@ -942,10 +547,10 @@ var g_ui = [ "ccs-res/cocosui/check_box_normal.png", "ccs-res/cocosui/check_box_normal_disable.png", "ccs-res/cocosui/check_box_normal_press.png", - "ccs-res/cocosui/CloseNormal.png", + s_pathClose, "ccs-res/cocosui/CloseSelected.png", "ccs-res/cocosui/green_edit.png", - "ccs-res/cocosui/grossini-aliases.png", + s_grossini_aliases, "ccs-res/cocosui/Hello.png", "ccs-res/cocosui/labelatlas.png", "ccs-res/cocosui/loadingbar.png", @@ -1104,13 +709,6 @@ var g_spine = [ "spine/goblins-ffd.json" ]; -var g_ccs2 = [ - "ActionTimeline/boy_1.csb", - "ActionTimeline/armature/Cowboy0.plist", - "ccs-res/cocosui/UIEditorTest/UILabelBMFont_Editor/GUI/missing-font.fnt", - "ccs-res/cocosui/UIEditorTest/UILabelBMFont_Editor/GUI/missing-font.png" -]; - if (!cc.sys.isNative) { var res = res || {}; res.CCControlColourPickerSpriteSheet_plist = "extensions/CCControlColourPickerSpriteSheet.plist";