|
-
- --------------------------------------------- 以下是测试用例 ---------------------------------------
-
- function testCoinAnimation()
- local nodeBegin = self.ui.Items.Button_AddDiamand
- local nodeEnd = self.ui.Items.Button_KeFu
- local goldNum = 100
- local goldIcon = "jinbi.png"
- local endCallback = function()
- showTooltip("onEnd")
- end
- --local sizeRange = cc.size(50, 50)
- playCoinAnimation(nodeBegin, nodeEnd, goldNum, goldIcon, endCallback, sizeRange);
- end
-
- function testPropAnimation()
- local nodeBegin = self.ui.Items.Button_AddDiamand
- local nodeEnd = self.ui.Items.Button_KeFu
- local propId = 10
- playPropAnimation(nodeBegin, nodeEnd, propId);
- end
-
- function testCopyStringFromClipboard()
- local str = copyStringFromClipboard()
- showTooltip(str)
- end
-
- function testBezier()
- local nodeBegin = self.ui.Items.Button_KeFu
- local nodeEnd = self.ui.Items.Button_AddGold
-
- local node1 = self.ui.Items.Layout_test_1
- local node2 = self.ui.Items.Layout_test_2
-
- local posBegin = nodeBegin:getWorldPosition()
- local posEnd = nodeEnd:getWorldPosition()
-
- local pos1 = node1:getWorldPosition()
- local pos2 = node2:getWorldPosition()
-
- local node = self.ui.Items.ImageView_5
- node:setPosition(posBegin)
-
- local bezier = cc.BezierTo:createWithPoints(1, pos1, pos2, posEnd);
- node:runAction(bezier);
- end
-
- function testChangeGpsInfo()
- local gpsStatus = 0;
- local rand = math.random(1, 100)
- if rand <= 50 then
- gpsStatus = 2;
- else
- gpsStatus = math.random(0, 3)
- end
-
- if gpsStatus == 2 then
- app.user.gpsInfo =
- {
- gpsStatus = gpsStatus,
- x = math.random(1000, 9999),
- y = math.random(1000, 9999),
-
- }
- else
- app.user.gpsInfo =
- {
- gpsStatus = gpsStatus,
- x = 0,
- y = 0,
- }
- end
- app.user:updateGpsInfo()
- showTooltip(tostring(gpsStatus))
- end
-
- local idx = 1;
- function testDropTips()
- idx = idx + 1
- app:dropNotice(tostring(idx))
- end
-
- --------------------------------------------- 以上是测试用例 ---------------------------------------
-
- function onTest()
- testDropTips()
- end
|