canvas (desktop)
Contains functions for working with graphics
Constants
VK_DOWN : number = 40
arrow down key code
VK_ESCAPE : number = 27
Esc key code
VK_FIRE : number = 10
Enter key code
VK_LEFT : number = 37
arrow left key code
VK_RIGHT : number = 39
arrow left key code
VK_UP : number = 38
arrow up key code
Functions
clip(x, y, w, h) — sets the current clip to the rectangle specified by the given coordinates
color(rgb) — sets color drawing. rgb - color with the specified combined RGB value
color(red, green, blue) — sets color with the specified red, green, and blue values in the range (0 - 255)
drawstring(text, x, y) — draws string text at position x, y
foval(x, y, w, h) — draws a filled oval at position x, y, size w, h
frect(x, y, w, h) — draws a filled rectangle at position x, y, size w, h
keypressed() — returns the code of the pressed key (see the constant section)
line(x1, y1, x2, y2) — draws line from point (x1;y1) to (x2;y2)
mousehover() — returns array with current mouse pointer coordinates
oval(x, y, w, h) — draws a oval at position x, y, size w, h
prompt(message) — displays a dialog box that prompts the visitor for input
rect(x, y, w, h) — draws a rectangle at position x, y, size w, h
repaint() — draws elements from graphics buffer on canvas
window(name, width, hight) — creates a new window with the specified name and size widthxheight