Rectangle class
A 2D axis-aligned rectangle with collision detection capabilities
Constructors
Properties
- bottom → double
-
Gets the bottom edge y-coordinate (computed property)
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- height → double
-
The height of the rectangle (extends down from y)
final
- left → double
-
Gets the left edge x-coordinate (same as x)
no setter
- right → double
-
Gets the right edge x-coordinate (computed property)
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- top → double
-
Gets the top edge y-coordinate (same as y)
no setter
- width → double
-
The width of the rectangle (extends right from x)
final
- x → double
-
The x-coordinate of the rectangle's left edge
final
- y → double
-
The y-coordinate of the rectangle's top edge
final
Methods
-
contains(
double px, double py) → bool - Checks if a point (px, py) is contained within this rectangle
-
intersects(
Rectangle other) → bool - Checks if this rectangle intersects with another rectangle
-
intersectsCircle(
double cx, double cy, double radius) → bool - Checks if this rectangle intersects with a circle
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited