All graphics functions.
Methods
-
inner Box(x1, y1, x2, y2, c)
-
draw a box.
Parameters:
Name Type Description x1number start x coordinate. y1number start y coordinate. x2number end x coordinate. y2number end y coordinate. cnumber color. -
inner Circle(x, y, r, c)
-
draw a circle.
Parameters:
Name Type Description xnumber x coordinate. ynumber y coordinate. rnumber radius. cnumber color. -
inner CircleArc(x, y, r, start, end, style, c) → {ArcInfo}
-
Draw a circle arc.
Parameters:
Name Type Description xnumber x coordinate. ynumber y coordinate. rnumber radius. startnumber start angle in tenths of degrees. endnumber end angle in tenths of degrees. style* value from ARC. cnumber color. Returns:
ArcInfo - detailed info about the drawn arc. -
inner ClearScreen(c)
-
clear the screen with given color.
Parameters:
Name Type Description cnumber the color. -
inner CustomCircle(x, y, r, w, c)
-
draw a circle with given width.
Parameters:
Name Type Description xnumber x coordinate. ynumber y coordinate. rnumber radius. wnumber line width. cnumber color. -
inner CustomCircleArc(x, y, r, start, end, style, w, c) → {ArcInfo}
-
Draw a circle arc with given width.
Parameters:
Name Type Description xnumber x coordinate. ynumber y coordinate. rnumber radius. startnumber start angle in tenths of degrees. endnumber end angle in tenths of degrees. style* value from ARC. wnumber line width. cnumber color. Returns:
ArcInfo - detailed info about the drawn arc. -
inner CustomEllipse(x, y, xr, yr, w, c)
-
draw a ellipse with given width.
Parameters:
Name Type Description xnumber x coordinate. ynumber y coordinate. xrnumber radius. yrnumber radius. wnumber line width. cnumber color. -
inner CustomLine(x1, y1, x2, y2, w, c)
-
draw a line with given width.
Parameters:
Name Type Description x1number start x coordinate. y1number start y coordinate. x2number end x coordinate. y2number end y coordinate. wnumber line width. cnumber color. -
inner Ellipse(x, y, xr, yr, c)
-
draw a ellipse.
Parameters:
Name Type Description xnumber x coordinate. ynumber y coordinate. xrnumber radius. yrnumber radius. cnumber color. -
inner FilledBox(x1, y1, x2, y2, c)
-
draw a filled box.
Parameters:
Name Type Description x1number start x coordinate. y1number start y coordinate. x2number end x coordinate. y2number end y coordinate. cnumber color. -
inner FilledCircle(x, y, r, c)
-
draw a filled circle.
Parameters:
Name Type Description xnumber x coordinate. ynumber y coordinate. rnumber radius. cnumber color. -
inner FilledEllipse(x, y, xr, yr, c)
-
draw a filled ellipse.
Parameters:
Name Type Description xnumber x coordinate. ynumber y coordinate. xrnumber radius. yrnumber radius. cnumber color. -
inner FilledPolygon(c, points)
-
draw a filled polygon.
Parameters:
Name Type Description cnumber color. pointsArray.<Array.<number>> an array of arrays with two coordinates (e.g. [[1, 1], [1, 10], [10, 10], [10, 1]]). -
inner FloodFill(x, y, bound, c)
-
do a flood fill.
Parameters:
Name Type Description xnumber x coordinate. ynumber y coordinate. boundnumber bound color. cnumber fill color. -
inner GetPixel(x, y) → {number}
-
get color of on-screen pixel.
Parameters:
Name Type Description xnumber x coordinate. ynumber y coordinate. Returns:
number - pixel color. -
inner GetScreenMode() → {number}
-
Get color depth info.
Returns:
number - bits per pixel. -
inner Line(x1, y1, x2, y2, c)
-
draw a line.
Parameters:
Name Type Description x1number start x coordinate. y1number start y coordinate. x2number end x coordinate. y2number end y coordinate. cnumber color. -
inner Plot(x, y, c)
-
draw a point.
Parameters:
Name Type Description xnumber x coordinate. ynumber y coordinate. cnumber color. -
inner SaveBmpImage(fname)
-
Save current screen to BMP file.
Parameters:
Name Type Description fnamestring filename. -
inner SavePcxImage(fname)
-
Save current screen to PCX file.
Parameters:
Name Type Description fnamestring filename. -
inner SaveTgaImage(fname)
-
Save current screen to TGA file.
Parameters:
Name Type Description fnamestring filename. -
inner SetRenderBitmap(bm)
-
set the current render destination.
Parameters:
Name Type Description bmBitmap A Bitmap to render on or null to use the screen as rendering destination. -
inner SizeX() → {number}
-
get the width of the drawing area.
Returns:
number - the width of the drawing area. -
inner SizeY() → {number}
-
get the height of the drawing area.
Returns:
number - the height of the drawing area. -
inner TextXY(x, y, text, fg, bg)
-
Draw a text with the default font.
Parameters:
Name Type Description xnumber x coordinate. ynumber y coordinate. text* the text to display. fgnumber foreground color. bgnumber background color. -
inner TransparencyEnabled(en)
-
Enable/disable the transparency when drawing.
Parameters:
Name Type Description enboolean true to enable transparency when drawing (might slow down drawing).