简体   繁体   中英

Transition.to during “moved” event issue on device

So basically, I have a paddle that rotates around the screen based around where the user is touching. In the corona simulator, my code works flawlessly... on my test device... that's another story.

    --All pseudocode for now but this is the gist of it
local function movePaddle(event)
local phase = phase

if phase == "began" then
--get angle of touch based on centerX/centerY
--get angle of paddle's current location
--get deltaAngle between the two using ((((touchAngle-   paddleAngle)%360)+540)%360)-180
transition.to(paddle,{rotation = deltaAngle, time = 200, delta = true, transition = easing.outElastic})

elseif phase == "moved" then 
--get angle of touch based on centerX/centerY
--get angle of paddle's current location
--get deltaAngle between the two using ((((touchAngle-paddleAngle)%360)+540)%360)-180
transition.to(paddle,{rotation = deltaAngle, time = 200, delta = true, transition = easing.outElastic})
end
end

On the simulator I have zero issues... When I run this on the device, the "began" phase works flawlessly but if a user drags his/her finger the paddle lags behind significantly. I've tried other easing functions to include not having one(which it defaults to linear iirc). My guess, is that when in the "moved" phase, the time in the transition.to is compounded.

Please help me out :( Is this a known issue with transition.to? I can provide exact code if needed.

Without seeing more of your code, it's possible that you're generating quite a few touch events which are creating quite a few transitions. I'm not sure I would transition the paddle, but just simply move it with the finger.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM