Module Sdlrect

module Sdlrect: sig .. end

Rectangles


Rect category

type t = {
   x : int;
   y : int;
   w : int;
   h : int;
}

A rectangle, with the origin at the upper left.

val make : pos:int * int -> dims:int * int -> t

currently an alias for make2

val make1 : int * int * int * int -> t
val make2 : pos:int * int -> dims:int * int -> t
val make4 : x:int -> y:int -> w:int -> h:int -> t
val move : t -> x:int -> y:int -> t
val has_intersection : a:t -> b:t -> bool
val intersect_rect_and_line : rect:t ->
p1:int * int -> p2:int * int -> (int * int * int * int) option
val point_in_rect : p:int * int -> r:t -> bool