16 lines
405 B
C#
16 lines
405 B
C#
using Godot;
|
|
|
|
public class H {
|
|
public static bool RectHasPointInclusive(Rect2I r, Vector2I p) {
|
|
if (r.HasPoint(p)) {
|
|
return true;
|
|
}
|
|
if (r.End.Y == p.Y && p.X >= r.Position.X && p.X <= r.End.X) {
|
|
return true;
|
|
}
|
|
if (r.End.X == p.X && p.Y >= r.Position.Y && p.Y <= r.End.Y) {
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
} |