简体   繁体   English

适用于cocos2d Android的CGRectIntersectsRect

[英]CGRectIntersectsRect for cocos2d Android

I'm currently trying to test for collisions between two CGRects. 我目前正在尝试测试两个CGRect之间的冲突。 Usually in Objective C I'd use the CGRectIntersectsRect method, but in Coso2d Android the only method available seems to be CGRect.containsRect which doesn't work as desired. 通常在Objective C中,我会使用CGRectIntersectsRect方法,但是在Coso2d Android中,唯一可用的方法似乎是CGRect.containsRect,该方法无法按预期工作。 Is there another way this must be done for Android? 对于Android,还有另一种方法吗?

I found intersects method in CGRect at github repo use that function to check intersect of two rect. 在github repo的CGRect中发现了相交方法,使用该函数检查两个rect的相交。

I also found one issue logged with the same and there is also a solution mention. 我还发现了一个记录有相同问题的问题,并且还提到了解决方案。

下载了包含CGRect.intersects方法的.jar文件的更新版本

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

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