'Intersect Bottom of the screen android
I have objects that are infinitely falling from the top of the screen to the bottom, and when they reach the bottom I want to delete them. They are stored in a ArrayList so removing them is easy, I just can't seem to figure out how to detect them intersecting the bottom of the screen using RectF.
Basically all I need is an imaginary line across the bottom.
Is that possible to do like this?
stickArr.get(i).getStick().intersect(a, b, c, d)//I don't exactly understand what to put into intersect
Solution 1:[1]
intersect(float left, float top, float right, float bottom)
If the rectangle specified by left,top,right,bottom intersects this rectangle, return true and set this rectangle to that intersection, otherwise return false and do not change this rectangle.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Glorfindel |
