Module

gfx

All graphics functions.

View Source doc/internal.js, line 208

Methods

# inner Box(x1, y1, x2, y2, c)

draw a box.
Parameters:
Name Type Description
x1 number start x coordinate.
y1 number start y coordinate.
x2 number end x coordinate.
y2 number end y coordinate.
c number color.

View Source doc/internal.js, line 280

# inner Circle(x, y, r, c)

draw a circle.
Parameters:
Name Type Description
x number x coordinate.
y number y coordinate.
r number radius.
c number color.

View Source doc/internal.js, line 289

# inner CircleArc(x, y, r, start, end, style, c) → {ArcInfo}

Draw a circle arc.
Parameters:
Name Type Description
x number x coordinate.
y number y coordinate.
r number radius.
start number start angle in tenths of degrees.
end number end angle in tenths of degrees.
style * value from ARC.
c number color.

View Source doc/internal.js, line 333

detailed info about the drawn arc.
ArcInfo

# inner ClearScreen(c)

clear the screen with given color.
Parameters:
Name Type Description
c number the color.

View Source doc/internal.js, line 241

# inner CustomCircle(x, y, r, w, c)

draw a circle with given width.
Parameters:
Name Type Description
x number x coordinate.
y number y coordinate.
r number radius.
w number line width.
c number color.

View Source doc/internal.js, line 299

# inner CustomCircleArc(x, y, r, start, end, style, w, c) → {ArcInfo}

Draw a circle arc with given width.
Parameters:
Name Type Description
x number x coordinate.
y number y coordinate.
r number radius.
start number start angle in tenths of degrees.
end number end angle in tenths of degrees.
style * value from ARC.
w number line width.
c number color.

View Source doc/internal.js, line 347

detailed info about the drawn arc.
ArcInfo

# inner CustomEllipse(x, y, xr, yr, w, c)

draw a ellipse with given width.
Parameters:
Name Type Description
x number x coordinate.
y number y coordinate.
xr number radius.
yr number radius.
w number line width.
c number color.

View Source doc/internal.js, line 320

# inner CustomLine(x1, y1, x2, y2, w, c)

draw a line with given width.
Parameters:
Name Type Description
x1 number start x coordinate.
y1 number start y coordinate.
x2 number end x coordinate.
y2 number end y coordinate.
w number line width.
c number color.

View Source doc/internal.js, line 270

# inner Ellipse(x, y, xr, yr, c)

draw a ellipse.
Parameters:
Name Type Description
x number x coordinate.
y number y coordinate.
xr number radius.
yr number radius.
c number color.

View Source doc/internal.js, line 309

# inner FilledBox(x1, y1, x2, y2, c)

draw a filled box.
Parameters:
Name Type Description
x1 number start x coordinate.
y1 number start y coordinate.
x2 number end x coordinate.
y2 number end y coordinate.
c number color.

View Source doc/internal.js, line 357

# inner FilledCircle(x, y, r, c)

draw a filled circle.
Parameters:
Name Type Description
x number x coordinate.
y number y coordinate.
r number radius.
c number color.

View Source doc/internal.js, line 366

# inner FilledEllipse(x, y, xr, yr, c)

draw a filled ellipse.
Parameters:
Name Type Description
x number x coordinate.
y number y coordinate.
xr number radius.
yr number radius.
c number color.

View Source doc/internal.js, line 376

# inner FilledPolygon(c, points)

draw a filled polygon.
Parameters:
Name Type Description
c number color.
points Array.<Array.<number>> an array of arrays with two coordinates (e.g. [[1, 1], [1, 10], [10, 10], [10, 1]]).

View Source doc/internal.js, line 392

# inner FloodFill(x, y, bound, c)

do a flood fill.
Parameters:
Name Type Description
x number x coordinate.
y number y coordinate.
bound number bound color.
c number fill color.

View Source doc/internal.js, line 385

# inner GetPixel(x, y) → {number}

get color of on-screen pixel.
Parameters:
Name Type Description
x number x coordinate.
y number y coordinate.

View Source doc/internal.js, line 434

pixel color.
number

# inner GetScreenMode() → {number}

Get color depth info.

View Source doc/internal.js, line 235

bits per pixel.
number

# inner Line(x1, y1, x2, y2, c)

draw a line.
Parameters:
Name Type Description
x1 number start x coordinate.
y1 number start y coordinate.
x2 number end x coordinate.
y2 number end y coordinate.
c number color.

View Source doc/internal.js, line 259

# inner Plot(x, y, c)

draw a point.
Parameters:
Name Type Description
x number x coordinate.
y number y coordinate.
c number color.

View Source doc/internal.js, line 249

# inner SaveBmpImage(fname)

Save current screen to BMP file.
Parameters:
Name Type Description
fname string filename.

View Source doc/internal.js, line 408

# inner SavePcxImage(fname)

Save current screen to PCX file.
Parameters:
Name Type Description
fname string filename.

View Source doc/internal.js, line 414

# inner SavePngImage(fname)

Save current screen to PNG file.
Parameters:
Name Type Description
fname string filename.

View Source doc/internal.js, line 426

# inner SaveTgaImage(fname)

Save current screen to TGA file.
Parameters:
Name Type Description
fname string filename.

View Source doc/internal.js, line 420

# inner SetRenderBitmap(bm)

set the current render destination.
Parameters:
Name Type Description
bm Bitmap A Bitmap to render on or null to use the screen as rendering destination.

View Source doc/internal.js, line 217

# inner SizeX() → {number}

get the width of the drawing area.

View Source doc/internal.js, line 223

the width of the drawing area.
number

# inner SizeY() → {number}

get the height of the drawing area.

View Source doc/internal.js, line 229

the height of the drawing area.
number

# inner TextXY(x, y, text, fg, bg)

Draw a text with the default font.
Parameters:
Name Type Description
x number x coordinate.
y number y coordinate.
text * the text to display.
fg number foreground color.
bg number background color.

View Source doc/internal.js, line 402

# inner TransparencyEnabled(en)

Enable/disable the transparency when drawing.
Parameters:
Name Type Description
en boolean true to enable transparency when drawing (might slow down drawing).

View Source doc/internal.js, line 440