Struct ggez::graphics::Rect [−][src]
Expand description
A simple 2D rectangle.
The origin of the rectangle is at the top-left, with x increasing to the right and y increasing down.
Fields
x: f32
X coordinate of the left edge of the rect.
y: f32
Y coordinate of the top edge of the rect.
w: f32
Total width of the rect
h: f32
Total height of the rect.
Implementations
Creates a new Rect
a la Love2D’s love.graphics.newQuad
,
as a fraction of the reference rect’s size.
Create a new rect from i32
coordinates.
Loses precision if the integers are too big to fit
in f32
’s.
Checks whether the Rect
contains a Point
Translates the Rect
by an offset of (x, y)
Moves the Rect
’s origin to (x, y)
Scales the Rect
by a factor of (sx, sy),
growing towards the bottom-left
Returns a new Rect
that includes all points of these two Rect
s.
Trait Implementations
The default tolerance to use when testing values that are close together. Read more
A test for equality that uses the absolute difference to compute the approximate equality of two numbers. Read more
The inverse of AbsDiffEq::abs_diff_eq
.
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
The default relative tolerance for testing values that are far-apart. Read more
A test for equality that uses a relative comparison if the values are far apart.
The inverse of RelativeEq::relative_eq
.
Auto Trait Implementations
impl RefUnwindSafe for Rect
impl UnwindSafe for Rect
Blanket Implementations
Mutably borrows from an owned value. Read more