Functor OcsfmlGraphics.Rect

module Rect: 
functor (M : RECT_VAL) -> sig .. end
Utility module for manipulating 2D axis aligned rectangles.

A rectangle is defined by its top-left corner and its size.

It is a very simple class defined for convenience, so its member variables (left, top, width and height) are public and can be accessed directly.

To keep things simple, rect doesn't define functions to emulate the properties that are not directly members (such as right, bottom, center, etc.), it rather only provides intersection functions.

rect uses the usual rules for its boundaries:

The left and top edges are included in the rectangle's area The right (left + width) and bottom (top + height) edges are excluded from the rectangle's area

This means that { left = 0; top = 0 ; width = 1; height = 1 } and { left = 0; top = 0 ; width = 1; height = 1 } don't intersect.

Parameters:
M : RECT_VAL

type 'a rect = {
   left : 'a;
   top : 'a;
   width : 'a;
   height : 'a;
}
type t = M.t rect 
val create : ?position:M.t * M.t -> ?size:M.t * M.t -> unit -> t
val contains : t -> M.t -> M.t -> bool
val contains_v : t -> M.t * M.t -> bool
val intersects : t ->
t -> t option