Struct raylib::core::math::Rectangle [−][src]
Fields
x: f32
y: f32
width: f32
height: f32
Implementations
Check collision between two rectangles
Checks collision between circle and rectangle.
Gets the overlap between two colliding rectangles.
use raylib::prelude::*;
fn main() {
let r1 = Rectangle::new(0.0, 0.0, 10.0, 10.0);
let r2 = Rectangle::new(20.0, 20.0, 10.0, 10.0);
assert_eq!(None, r1.get_collision_rec(&r2));
assert_eq!(Some(r1), r1.get_collision_rec(&r1));
}
Checks if point is inside rectangle.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Rectangle
impl UnwindSafe for Rectangle
Blanket Implementations
Mutably borrows from an owned value. Read more