检测iPhone中两个移动按钮的碰撞
我正在使用下面的功能移动屏幕上的两个按钮检测iPhone中两个移动按钮的碰撞,iphone,animation,collision-detection,Iphone,Animation,Collision Detection,我正在使用下面的功能移动屏幕上的两个按钮 + (void)animateWithDuration:(NSTimeInterval)duration delay:(NSTimeInterval)delay options:(UIViewAnimationOptions)options animations:(void (^)(void))animations completion:(void (^)(BOOL finished)); 现在我想检测这些移动按钮的碰撞 所以我想知道,当对象正在设置动
+ (void)animateWithDuration:(NSTimeInterval)duration delay:(NSTimeInterval)delay options:(UIViewAnimationOptions)options animations:(void (^)(void))animations completion:(void (^)(BOOL finished));
现在我想检测这些移动按钮的碰撞
所以我想知道,当对象正在设置动画(移动)时,是否有任何事件被触发。
或者我还能把我的健康状况放在哪里
CGRectIntersectsRect(,);
是一个“火和忘记”类型的动画。您无法访问内部构件。这是自动的
如果需要进行碰撞检测,可以使用Cocos2D之类的2D精灵库,也可以设置计时器手动移动按钮并设置其动画。我确实这样做了。上面写的是Cocos2D,但看起来是某个善良的灵魂为我编辑的。
+ (void)animateWithDuration:(NSTimeInterval)duration delay:(NSTimeInterval)delay options:(UIViewAnimationOptions)options animations:(void (^)(void))animations completion:(void (^)(BOOL finished));