module Graphics_js:sig
..end
include Graphics
type
context
type of a graphic context
val open_graph : string -> unit
val open_canvas : Dom_html.canvasElement Js.t -> unit
val get_context : unit -> context
val set_context : context -> unit
val loop : event list -> (status -> unit) -> unit
Loops forever and listen to the given events. Those events automatically
returns a status record, which is used by the function given in argument.
val mouse_pos : unit -> (int * int) Lwt.t
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
.
unit -> bool Lwt.t
: true
if the mouse button is pressed, false
otherwise.val read_key : unit -> char Lwt.t