Graphics_jsJavascript binding for Graphics lib
include module type of Graphicsval rgb : int -> int -> int -> colorval set_color : color -> unitval background : colorval foreground : colorval black : colorval white : colorval red : colorval green : colorval blue : colorval yellow : colorval cyan : colorval magenta : colorval point_color : int -> int -> colorval transp : colorval draw_image : image -> int -> int -> unitval get_image : int -> int -> int -> int -> imageval create_image : int -> int -> imageval blit_image : image -> int -> int -> unitOpen a graphics window. The graphics window is cleared and the current point is set to (0, 0). The string argument is used to pass optional information on the desired graphics mode, the graphics window size, and so on. Specification can be found at http://www.w3schools.com/jsref/met_win_open.asp. Note: an extra specification is available, "target", to specifies the target attribute or the name of the window.
val open_canvas : Js_of_ocaml.Dom_html.canvasElement Js_of_ocaml.Js.t -> unituse a canvas to setup the current context
val get_context : unit -> contextGet the current context
val set_context : context -> unitSet the current context
Loops forever and listen to the given events. Those events automatically returns a status record, which is used by the function given in argument.
Return the position of the mouse cursor, relative to the graphics window. If the mouse cursor is outside of the graphics window, mouse_pos() returns a point outside of the range 0..size_x()-1, 0..size_y()-1.