我想在我的代码中放入一些睡眠,但我不知道正确的语法。我想把它放在TouchMove
里面,这样在移动到另一个像素之前,像素的每次移动都会有一定数量的睡眠。
--this program will pick random spots for x,y and will slide down 5 pixels
--define section
local iX
local iY
local iLoop
--initialize variables
--randomize variables
iX=40
iY=math.random(100,150)
--touchdown finger
--execute move for touchup
print("TouchDown ".. "(" .. iX .. "," .. iY .. ")" )
--touchmove finger
--slide down 5 pixels
for iLoop = 1,5 do
--compute for next pixel
iX= iX - 1
--execute move for touchmove
print("TouchMove ".. "(" .. iX..","..iY .. ")" )
end
--pick up finger
--execute move for touchup
print("TouchUp " .. "(" .. iX .. "," .. iY .. ")" )
答案 0 :(得分:0)