Method
public bool Intersects(Rect2i rect)
|
Parameters
Returns
bool
True if there is an intersection, false otherwise.
DescriptionChecks if there is an intersections with another rectangle. Examplevoid Update() { if (playerRect.Intersects(blockRect)) { var depth = playerRect.IntersectionDepth(blockRect); playerRect.x += (int)depth.x; playerRect.y += (int)depth.y; } } |
See AlsoRect2i.IntersectionDepth Rect2i.Intersect Rect2i.Contains |