All graphics functions.

# 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.

#### # 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.

#### # 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 with 256 representing a full circle.
`end` | number | end angle with 256 representing a full circle.
`style` | * | value from ARC.
`c` | number | color.

Returns:

detailed info about the drawn arc.

Type: ArcInfo

#### # inner ClearScreen(c)

clear the screen with given color.

##### Parameters:

Name | Type | Description
--- | --- | ---
`c` | number | the color.

#### # 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.

#### # 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 with 256 representing a full circle.
`end` | number | end angle with 256 representing a full circle.
`style` | * | value from ARC.
`w` | number | line width.
`c` | number | color.

Returns:

detailed info about the drawn arc.

Type: 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.

#### # 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.

#### # 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.

#### # 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.

#### # 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.

#### # 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.

#### # 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]]).

#### # 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.

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

get color of on-screen pixel.

##### Parameters:

Name | Type | Description
--- | --- | ---
`x` | number | x coordinate.
`y` | number | y coordinate.

Returns:

pixel color.

Type: number

#### # inner GetScreenMode() → {number}

Get color depth info.

Returns:

bits per pixel.

Type: 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.

#### # inner Plot(x, y, c)

draw a point.

##### Parameters:

Name | Type | Description
--- | --- | ---
`x` | number | x coordinate.
`y` | number | y coordinate.
`c` | number | color.

#### # inner SaveBmpImage(fname)

Save current screen to BMP file.

##### Parameters:

Name | Type | Description
--- | --- | ---
`fname` | string | filename.

#### # inner SavePcxImage(fname)

Save current screen to PCX file.

##### Parameters:

Name | Type | Description
--- | --- | ---
`fname` | string | filename.

#### # inner SavePngImage(fname)

Save current screen to PNG file.

Note: PNG module must be loaded by calling LoadLibrary("png") before using this function!

##### Parameters:

Name | Type | Description
--- | --- | ---
`fname` | string | filename.

See:
  - LoadLibrary()

#### # inner SaveTgaImage(fname)

Save current screen to TGA file.

##### Parameters:

Name | Type | Description
--- | --- | ---
`fname` | string | filename.

#### # 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.

#### # inner SizeX() → {number}

get the width of the drawing area.

Returns:

the width of the drawing area.

Type: number

#### # inner SizeY() → {number}

get the height of the drawing area.

Returns:

the height of the drawing area.

Type: 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.

#### # inner TransparencyEnabled(mode)

Set the blend mode for drawing.

##### Parameters:

Name | Type | Description
--- | --- | ---
`mode` | number | one of the blend modes, e.g. BLEND.ALPHA or BLEND.REPLACE.

See:
  - BLEND in the color module