Library
Module
Module type
Parameter
Class
Class type
Low-level graphics and colors
This module is internally used for low-level graphics and a thin layer over Tsdl.
The public API is mainly useful for Color management.
type texture = Tsdl.Sdl.texture
val black : rgb
val grey : rgb
val pale_grey : rgb
val dark_grey : rgb
val white : rgb
val red : rgb
val blue : rgb
val green : rgb
val magenta : rgb
val cyan : rgb
val yellow : rgb
val sienna : rgb
val label_color : rgb
val none : color
none = (0,0,0,0)
is completely transparent black.
val find_color : string -> rgb
Convert a string of the form "grey"
or "#FE01BC"
to a rgb code (r,g,b)
. Color names are taken from here.
val set_color : Tsdl.Sdl.renderer -> color -> unit
Equivalent to Sdl.set_render_draw_color
.
Layers are used to decide the order of drawing: which graphical elements (layouts) should be below, which should be above. For the most part, you don't have to access them directly.
Use this when you want to switch to a completely different set of layers, typically when you want to draw on another window.
Transform a size (W,H) in physical pixels into 'logical' pixels (w,h), which are used for layouts. This is done by dividing by the Theme
SCALE
variable.
val set_system_cursor : Tsdl.Sdl.System_cursor.t -> unit
Set the mouse cursor to be the standard system cursor. Internally, this first creates a SDL system cursor (or use a previously created one).