简体   繁体   English

如何检测UIImageview的动画方向?

[英]How do I detect which direction a UIImageview is animating?

What is the best way to detect the direction of a uiimageview? 检测uiimageview方向的最佳方法是什么?

I want to detect when a uiimageview is 'falling' - this is because it follows an arc animation for jumping purposes, i only want to detect when it is 'falling' and intersecting a floor, rather than when it jumps and intersects the floor. 我想检测uiimageview何时“下降” - 这是因为它遵循弧形动画用于跳跃目的,我只想检测它何时“下降”并与地板相交,而不是当它跳跃并与地板相交时。

I'm guessing there is no built in method to do this. 我猜测没有内置的方法来做到这一点。

Thanks in advance! 提前致谢!

The best thing to do, I found, was to draw a path and test it for collision with any above 'floors' or platforms. 我发现,最好的办法是绘制一条路径并测试它是否与任何上面的“地板”或平台相撞。 Then if it does collide, draw another path with an end point matching the y position of the collided platform. 然后,如果碰撞,则绘制另一条路径,其终点与碰撞平台的y位置匹配。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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