Struct sfml_types::Rect [] [src]

#[repr(C)]
pub struct Rect<T> { pub left: T, pub top: T, pub width: T, pub height: T, }

Utility type for manipulating 2D axis-aligned rectangles.

Fields

Left coordinate of the rectangle.

Top coordinate of the rectangle.

Width of the rectangle.

Height of the rectangle.

Methods

impl<T> Rect<T>
[src]

Construct a rectangle from its coordinates.

Construct a rectangle from its position and size.

impl<T: PartialOrd + Add<Output = T> + Sub<Output = T> + Copy> Rect<T>
[src]

Check if a point is inside the rectangle's area.

Check if a point is inside the rectangle's area.

Check the intersection between two rectangles.

If the rectangles intersect, returns Some filled with the intersection of the two rectangles. Otherwise, returns None.

Trait Implementations

impl<T: Clone> Clone for Rect<T>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<T: PartialEq> PartialEq for Rect<T>
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl<T: Eq> Eq for Rect<T>
[src]

impl<T: PartialOrd> PartialOrd for Rect<T>
[src]

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl<T: Ord> Ord for Rect<T>
[src]

This method returns an Ordering between self and other. Read more

impl<T: Debug> Debug for Rect<T>
[src]

Formats the value using the given formatter.

impl<T: Copy> Copy for Rect<T>
[src]

impl<T: Default> Default for Rect<T>
[src]

Returns the "default value" for a type. Read more