From cb8cde63b1bba0cfbcf09f5ba972ecf9936e29eb Mon Sep 17 00:00:00 2001 From: ViusualSJ Date: Fri, 6 May 2016 17:19:33 +0800 Subject: [PATCH] loader test bug --- tests/js-tests/src/LoaderTest/LoaderTest.js | 33 ++++++--------------- 1 file changed, 9 insertions(+), 24 deletions(-) diff --git a/tests/js-tests/src/LoaderTest/LoaderTest.js b/tests/js-tests/src/LoaderTest/LoaderTest.js index f9b9d8d6ff..7ecd0e5e49 100644 --- a/tests/js-tests/src/LoaderTest/LoaderTest.js +++ b/tests/js-tests/src/LoaderTest/LoaderTest.js @@ -101,16 +101,19 @@ var LoaderCycleLayer = BaseTestLayer.extend({ var index = 0; var winSize = cc.director.getWinSize(); + + var resultTTF = new cc.LabelTTF("result: unknown"); + resultTTF.x = winSize.width / 2; + resultTTF.y = winSize.height / 2; + var t = this, cb = function(num){ - var labelTTF = new cc.LabelTTF(num + " file failed"); - labelTTF.x = index++*100 + winSize.width - 150; - labelTTF.y = winSize.height / 2 - 20; + resultTTF.setString("result: " + num + " file load failed"); if(num === 1) - labelTTF.setColor(cc.color.GREEN); + resultTTF.setColor(cc.color.GREEN); else - labelTTF.setColor(cc.color.RED); - t.addChild(labelTTF); + resultTTF.setColor(cc.color.RED); + t.addChild(resultTTF); if(index < 4) t.test(cb); }; @@ -161,24 +164,6 @@ var LoaderCycleLayer = BaseTestLayer.extend({ this.addChild(info1); this.addChild(info2); this.addChild(info3); - - var info4 = new cc.LabelTTF("test 1"); - info4.x = winSize.width / 2 - 50; - info4.y = winSize.height / 2; - var info5 = new cc.LabelTTF("test 2"); - info5.x = winSize.width / 2 - 150; - info5.y = winSize.height / 2; - var info6 = new cc.LabelTTF("test 3"); - info6.x = winSize.width / 2 + 50; - info6.y = winSize.height / 2; - var info7 = new cc.LabelTTF("test 4"); - info7.x = winSize.width / 2 + 150; - info7.y = winSize.height / 2; - - this.addChild(info4); - this.addChild(info5); - this.addChild(info6); - this.addChild(info7); }, test: function(cb){