Module Gamelle.Size

Sizes: width and height dimensions.

type t = xy

The type of sizes in 2D.

val v : float -> float -> t

v w h is a size with width w and height h.

Accessors

val width : t -> float

width s is the width of s.

val height : t -> float

height s is the height of s.

Draw

val draw : io:io -> ?color:Color.t -> at:Point.t -> t -> unit

draw ~io ~at t draws the box with top-left corner at and size t.

val fill : io:io -> ?color:Color.t -> at:Point.t -> t -> unit

fill ~io ~at t fills the box with top-left at and size t.

val pp : Stdlib.Format.formatter -> t -> unit

Format.printf "%a" pp t pretty prints the size t dimensions.