Skip to content

Graphics

Functions

Draw Circle

Draw Circle

Draw a circle on the current window. The circle is centred on its x, y coordinates, and has the provided radius.

Parameters:

NameTypeDescription
clrColorThe color of the circle
cCircleThe circle being drawn

Signatures:

void draw_circle(color clr, const circle &c)

Draw Circle

Draw a circle with the provided drawing options, which may include options related to the drawing destination.

Parameters:

NameTypeDescription
clrColorThe color of the circle
cCircleThe circle being drawn
optsDrawing OptionsDrawing options to configure the drawing operation

Signatures:

void draw_circle(color clr, const circle &c, drawing_options opts)

Draw Circle

Draw a circle onto the current window. The circle is centred on its x, y coordinates, and has the provided radius.

Parameters:

NameTypeDescription
clrColorThe color of the circle
xDoubleThe x location of the circle
yDoubleThe y location of the circle
radiusDoubleThe radius of the circle

Signatures:

void draw_circle(color clr, double x, double y, double radius)

Draw Circle

Draw a circle using the supplied drawing options. The circle is centred on its x, y coordinates, and has the provided radius. This will use Drawing Options to determine the destination.

Parameters:

NameTypeDescription
clrColorThe color of the circle
xDoubleThe x location of the circle
yDoubleThe y location of the circle
radiusDoubleThe radius of the circle
optsDrawing OptionsDrawing options to configure the drawing operation

Signatures:

void draw_circle(color clr, double x, double y, double radius, drawing_options opts)

Draw Circle On Bitmap

Draw Circle On Bitmap

Draw a circle onto the destination bitmap. The circle is centred on its x, y coordinates, and has the provided radius.

Parameters:

NameTypeDescription
destinationBitmapThe destination bitmap
clrColorThe color of the circle
xDoubleThe x location of the circle
yDoubleThe y location of the circle
radiusDoubleThe radius of the circle

Signatures:

void draw_circle_on_bitmap(bitmap destination, color clr, double x, double y, double radius)

Draw Circle On Bitmap

Draw a circle to the bitmap using the supplied drawing options. The circle is centred on its x, y coordinates, and has the provided radius.

Parameters:

NameTypeDescription
destinationBitmapThe destination bitmap
clrColorThe color of the circle
xDoubleThe x location of the circle
yDoubleThe y location of the circle
radiusDoubleThe radius of the circle
optsDrawing OptionsDrawing options to configure the drawing operation

Signatures:

void draw_circle_on_bitmap(bitmap destination, color clr, double x, double y, double radius, drawing_options opts)

Draw Circle On Window

Draw Circle On Window

Draw a circle onto the destination window. The circle is centred on its x, y coordinates, and has the provided radius.

Parameters:

NameTypeDescription
destinationWindowThe destination window
clrColorThe color of the circle
xDoubleThe x location of the circle
yDoubleThe y location of the circle
radiusDoubleThe radius of the circle

Signatures:

void draw_circle_on_window(window destination, color clr, double x, double y, double radius)

Draw Circle On Window

Draw a circle to the window using the supplied drawing options. The circle is centred on its x, y coordinates, and has the provided radius.

Parameters:

NameTypeDescription
destinationWindowThe destination window
clrColorThe color of the circle
xDoubleThe x location of the circle
yDoubleThe y location of the circle
radiusDoubleThe radius of the circle
optsDrawing OptionsDrawing options to configure the drawing operation

Signatures:

void draw_circle_on_window(window destination, color clr, double x, double y, double radius, drawing_options opts)

Fill Circle

Fill Circle

Draw a circle on the current window. The circle is centred on its x, y coordinates, and has the provided radius.

Parameters:

NameTypeDescription
clrColorThe color of the circle
cCircleThe circle being drawn

Signatures:

void fill_circle(color clr, const circle &c)

Fill Circle

Fill a circle with the provided drawing options, which may include options related to the drawing destination.

Parameters:

NameTypeDescription
clrColorThe color of the circle
cCircleThe circle being drawn
optsDrawing OptionsDrawing options to configure the drawing operation

Signatures:

void fill_circle(color clr, const circle &c, drawing_options opts)

Fill Circle

Fill a circle onto the current window. The circle is centred on its x, y coordinates, and has the provided radius.

Parameters:

NameTypeDescription
clrColorThe color of the circle
xDoubleThe x location of the circle
yDoubleThe y location of the circle
radiusDoubleThe radius of the circle

Signatures:

void fill_circle(color clr, double x, double y, double radius)

Fill Circle

Fill a circle using the supplied drawing options. The circle is centred on its x, y coordinates, and has the provided radius. This will use Drawing Options to determine the destination.

Parameters:

NameTypeDescription
clrColorThe color of the circle
xDoubleThe x location of the circle
yDoubleThe y location of the circle
radiusDoubleThe radius of the circle
optsDrawing OptionsDrawing options to configure the drawing operation

Signatures:

void fill_circle(color clr, double x, double y, double radius, drawing_options opts)

Fill Circle On Bitmap

Fill Circle On Bitmap

Fill a circle onto the destination bitmap. The circle is centred on its x, y coordinates, and has the provided radius.

Parameters:

NameTypeDescription
destinationBitmapThe destination bitmap
clrColorThe color of the circle
xDoubleThe x location of the circle
yDoubleThe y location of the circle
radiusDoubleThe radius of the circle

Signatures:

void fill_circle_on_bitmap(bitmap destination, color clr, double x, double y, double radius)

Fill Circle On Bitmap

Fill a circle to the bitmap using the supplied drawing options. The circle is centred on its x, y coordinates, and has the provided radius.

Parameters:

NameTypeDescription
destinationBitmapThe destination bitmap
clrColorThe color of the circle
xDoubleThe x location of the circle
yDoubleThe y location of the circle
radiusDoubleThe radius of the circle
optsDrawing OptionsDrawing options to configure the drawing operation

Signatures:

void fill_circle_on_bitmap(bitmap destination, color clr, double x, double y, double radius, drawing_options opts)

Fill Circle On Window

Fill Circle On Window

Fill a circle onto the destination window. The circle is centred on its x, y coordinates, and has the provided radius.

Parameters:

NameTypeDescription
destinationWindowThe destination window
clrColorThe color of the circle
xDoubleThe x location of the circle
yDoubleThe y location of the circle
radiusDoubleThe radius of the circle

Signatures:

void fill_circle_on_window(window destination, color clr, double x, double y, double radius)

Fill Circle On Window

Fill a circle to the window using the supplied drawing options. The circle is centred on its x, y coordinates, and has the provided radius.

Parameters:

NameTypeDescription
destinationWindowThe destination window
clrColorThe color of the circle
xDoubleThe x location of the circle
yDoubleThe y location of the circle
radiusDoubleThe radius of the circle
optsDrawing OptionsDrawing options to configure the drawing operation

Signatures:

void fill_circle_on_window(window destination, color clr, double x, double y, double radius, drawing_options opts)

Current Clip

Current Clip

Returns the rectangle of the current clip area for the current window

Return Type: Rectangle

Signatures:

rectangle current_clip()

Current Clip

Returns the rectangle of the current clip area for a bitmap

Parameters:

NameTypeDescription
bmpBitmapThe bitmap to get the clipping rectangle from

Return Type: Rectangle

Signatures:

rectangle current_clip(bitmap bmp)

Current Clip

Returns the rectangle of the current clip area for a window

Parameters:

NameTypeDescription
wndWindowThe window to get the clipping rectangle from

Return Type: Rectangle

Signatures:

rectangle current_clip(window wnd)

Pop Clip

Pop Clip

Remove the last clipping rectangle pushed to the window. This will then apply the previously pushed clipping rectangle.

Parameters:

NameTypeDescription
wndWindowThe window to change

Signatures:

void pop_clip(window wnd)

Pop Clip

Remove the last clipping rectangle pushed to the current window. This will then apply the previously pushed clipping rectangle.

Signatures:

void pop_clip()

Pop Clip

Remove the last clipping rectangle pushed to the bitmap. This will then apply the previously pushed clipping rectangle.

Parameters:

NameTypeDescription
bmpBitmapThe bitmap to change

Signatures:

void pop_clip(bitmap bmp)

Push Clip

Push Clip

Add the clipping rectangle of a window and uses the intersect between the new rectangle and previous clip. When a clipping rectangle is provided, drawing operations will only affect the area specified in the current clipping rectangle.

Parameters:

NameTypeDescription
wndWindowThe window to add clipping to
rRectangleThe new clipping rectangle

Signatures:

void push_clip(window wnd, const rectangle &r)

Push Clip

Add the clipping rectangle of a bitmap and uses the intersect between the new rectangle and previous clip. When a clipping rectangle is provided, drawing operations will only affect the area specified in the current clipping rectangle.

Parameters:

NameTypeDescription
bmpBitmapThe bitmap to add clipping to
rRectangleThe new clipping rectangle

Signatures:

void push_clip(bitmap bmp, const rectangle &r)

Push Clip

Push a clip rectangle to the current window. The resulting clipping rectangle will be the intersection of the existing clipping rectangle with the new rectangle provided in this call. This can be undone using Pop Clip. When a clipping rectangle is provided, drawing operations will only affect the area specified in the current clipping rectangle.

Parameters:

NameTypeDescription
rRectangleThe new clipping rectangle

Signatures:

void push_clip(const rectangle &r)

Reset Clip

Reset Clip

Reset the clipping rectangle on a bitmap. This will clear all of the clipping rectangles pushed to the bitmap.

Parameters:

NameTypeDescription
bmpBitmapThe bitmap to clear the clipping rectangle

Signatures:

void reset_clip(bitmap bmp)

Reset Clip

Reset the clipping rectangle of the current window. This will clear all of the clipping rectangles pushed to the current window.

Signatures:

void reset_clip()

Reset Clip

Reset the clipping rectangle on a window. This will clear all of the clipping rectangles pushed to the window.

Parameters:

NameTypeDescription
wndWindowThe window to clear the clipping rectangle

Signatures:

void reset_clip(window wnd)

Set Clip

Set Clip

Set the clip rectangle of the current window. This will clear any existing clipping rectangles pushed to the current window, and use the supplied rectangle for clipping.

Parameters:

NameTypeDescription
rRectangleThe new clipping rectangle

Signatures:

void set_clip(const rectangle &r)

Set Clip

Set the clip rectangle of the bitmap. This will clear any existing clipping rectangles pushed to the bitmap, and use the supplied rectangle for clipping.

Parameters:

NameTypeDescription
bmpBitmapThe bitmap to change
rRectangleThe new clipping rectangle

Signatures:

void set_clip(bitmap bmp, const rectangle &r)

Set Clip

Set the clip rectangle of the window. This will clear any existing clipping rectangles pushed to the window, and use the supplied rectangle for clipping.

Parameters:

NameTypeDescription
wndWindowThe window to change
rRectangleThe new clipping rectangle

Signatures:

void set_clip(window wnd, const rectangle &r)

Option Defaults

Returns a Drawing Options with default values. This will draw to the current window, with default scale of 1, no rotation or offset, not flipped, drawing whole images, with default camera mechanisms and line width.

Return Type: Drawing Options

Signatures:

drawing_options option_defaults()

Option Draw To

Option Draw To

Use this option to draw to a Bitmap. Pass dest the Bitmap you want to draw on.

Parameters:

NameTypeDescription
destBitmapThe bitmap to draw to.

Return Type: Drawing Options

Signatures:

drawing_options option_draw_to(bitmap dest)

Option Draw To

Use this option to draw to a Bitmap. Pass dest the Bitmap you want to draw on. Pass opts the other options you want use.

Parameters:

NameTypeDescription
destBitmapThe bitmap to draw to.
optsDrawing OptionsValues for the other options.

Return Type: Drawing Options

Signatures:

drawing_options option_draw_to(bitmap dest, drawing_options opts)

Option Draw To

Use this option to draw to a specified Window. Pass dest the Window you want to draw on.

Parameters:

NameTypeDescription
destWindowThe window to draw onto.

Return Type: Drawing Options

Signatures:

drawing_options option_draw_to(window dest)

Option Draw To

Use this option to draw to a Bitmap. Pass dest the Bitmap you want to draw on to. Pass opts the other options you want use.

Parameters:

NameTypeDescription
destWindowThe window to draw onto.
optsDrawing OptionsValues for the other options.

Return Type: Drawing Options

Signatures:

drawing_options option_draw_to(window dest, drawing_options opts)

Option Flip X

Option Flip X

Use this option to flip an image along its X axis.

Return Type: Drawing Options

Signatures:

drawing_options option_flip_x()

Option Flip X

Use this option to flip an image along its X axis.

Parameters:

NameTypeDescription
optsDrawing OptionsValues for the other options.

Return Type: Drawing Options

Signatures:

drawing_options option_flip_x(drawing_options opts)

Option Flip Xy

Option Flip Xy

Use this option to flip the drawing of an image along both X and Y axis.

Return Type: Drawing Options

Signatures:

drawing_options option_flip_xy()

Option Flip Xy

Use this option to flip the drawing of an image along both X and Y axis.

Parameters:

NameTypeDescription
optsDrawing OptionsValues for the other options.

Return Type: Drawing Options

Signatures:

drawing_options option_flip_xy(drawing_options opts)

Option Flip Y

Option Flip Y

Use this option to flip the drawing of an image along its Y axis.

Return Type: Drawing Options

Signatures:

drawing_options option_flip_y()

Option Flip Y

Use this option to flip the drawing of an image along its Y axis.

Parameters:

NameTypeDescription
optsDrawing OptionsValues for the other options.

Return Type: Drawing Options

Signatures:

drawing_options option_flip_y(drawing_options opts)

Option Line Width

Option Line Width

Use this option to change the width of line drawings.

Parameters:

NameTypeDescription
widthIntegerThe new line width for line drawing.

Return Type: Drawing Options

Signatures:

drawing_options option_line_width(int width)

Option Line Width

Use this option to change the width of line drawings.

Parameters:

NameTypeDescription
widthIntegerThe new line width for line drawing.
optsDrawing OptionsValues for the other options.

Return Type: Drawing Options

Signatures:

drawing_options option_line_width(int width, drawing_options opts)

Option Part Bmp

Option Part Bmp

Use this option to draw only a part of a bitmap.

Parameters:

NameTypeDescription
xDoubleThe x coordinate of the part within the bitmap.
yDoubleThe y coordinate of the part within the bitmap.
wDoubleThe width of the part within the bitmap.
hDoubleThe height of the part within the bitmap.

Return Type: Drawing Options

Signatures:

drawing_options option_part_bmp(double x, double y, double w, double h)

Option Part Bmp

Use this option to draw only a part of a bitmap.

Parameters:

NameTypeDescription
xDoubleThe x coordinate of the part within the bitmap.
yDoubleThe y coordinate of the part within the bitmap.
wDoubleThe width of the part within the bitmap.
hDoubleThe height of the part within the bitmap.
optsDrawing OptionsValues for the other options.

Return Type: Drawing Options

Signatures:

drawing_options option_part_bmp(double x, double y, double w, double h, drawing_options opts)

Option Part Bmp

Use this option to draw only part of a bitmap.

Parameters:

NameTypeDescription
partRectangleThe rectangle of the part of the bitmap to draw.

Return Type: Drawing Options

Signatures:

drawing_options option_part_bmp(rectangle part)

Option Part Bmp

Use this option to draw only part of a bitmap.

Parameters:

NameTypeDescription
partRectangleThe rectangle of the part of the bitmap to draw.
optsDrawing OptionsValues for the other options.

Return Type: Drawing Options

Signatures:

drawing_options option_part_bmp(rectangle part, drawing_options opts)

Option Rotate Bmp

Option Rotate Bmp

Use this option to rotate a bitmap around its centre point.

Parameters:

NameTypeDescription
angleDoubleThe angle to rotate bitmaps.

Return Type: Drawing Options

Signatures:

drawing_options option_rotate_bmp(double angle)

Option Rotate Bmp

Use this option to rotate the drawing of a bitmap. This allows you to set the anchor point and rotate around that by a number of degrees. Pass opts the other options you want use.

Parameters:

NameTypeDescription
angleDoubleThe angle to rotate bitmaps.
anchor_xDoubleThe x location of the anchor within the bitmap
anchor_yDoubleThe y location of the anchor within the bitmap

Return Type: Drawing Options

Signatures:

drawing_options option_rotate_bmp(double angle, double anchor_x, double anchor_y)

Option Rotate Bmp

Use this option to rotate the drawing of a bitmap. This allows you to set the anchor point and rotate around that by a number of degrees. Pass opts the other options you want use.

Parameters:

NameTypeDescription
angleDoubleThe angle to rotate bitmaps.
anchor_xDoubleThe x location of the anchor within the bitmap
anchor_yDoubleThe y location of the anchor within the bitmap
optsDrawing OptionsValues for the other options.

Return Type: Drawing Options

Signatures:

drawing_options option_rotate_bmp(double angle, double anchor_x, double anchor_y, drawing_options opts)

Option Rotate Bmp

Use this option to rotate a bitmap around its centre point.

Parameters:

NameTypeDescription
angleDoubleThe angle to rotate bitmaps.
optsDrawing OptionsValues for the other options.

Return Type: Drawing Options

Signatures:

drawing_options option_rotate_bmp(double angle, drawing_options opts)

Option Scale Bmp

Option Scale Bmp

Use this option to scale the drawing of bitmaps. You can scale x and y separately.

Parameters:

NameTypeDescription
scale_xDoubleThe amount to scale bitmaps aalong the x axis
scale_yDoubleThe amount to scale bitmaps aalong the y axis

Return Type: Drawing Options

Signatures:

drawing_options option_scale_bmp(double scale_x, double scale_y)

Option Scale Bmp

Use this option to scale the drawing of bitmaps. You can scale x and y separately. Pass opts the other options you want use.

Parameters:

NameTypeDescription
scale_xDoubleThe amount to scale bitmaps aalong the x axis
scale_yDoubleThe amount to scale bitmaps aalong the y axis
optsDrawing OptionsValues for the other options.

Return Type: Drawing Options

Signatures:

drawing_options option_scale_bmp(double scale_x, double scale_y, drawing_options opts)

Option To Screen

Option To Screen

Use this option to draw to the screen, ignoring the positon of the camera.

Return Type: Drawing Options

Signatures:

drawing_options option_to_screen()

Option To Screen

Use this option to draw to the screen, ignoring the positon of the camera.

Parameters:

NameTypeDescription
optsDrawing OptionsValues for the other options.

Return Type: Drawing Options

Signatures:

drawing_options option_to_screen(drawing_options opts)

Option To World

Option To World

Use this option to draw in World coordinates — these are affected by the movement of the camera.

Return Type: Drawing Options

Signatures:

drawing_options option_to_world()

Option To World

Use this option to draw in World coordinates — these are affected by the movement of the camera.

Parameters:

NameTypeDescription
optsDrawing OptionsValues for the other options.

Return Type: Drawing Options

Signatures:

drawing_options option_to_world(drawing_options opts)

Option With Animation

Option With Animation

Use details from the animation to select an appropriate cell from the bitmaps being drawn.

Parameters:

NameTypeDescription
animAnimationThe animation with the cell details to be used.

Return Type: Drawing Options

Signatures:

drawing_options option_with_animation(animation anim)

Option With Animation

Use details from the animation to select an appropriate cell from the bitmaps being drawn. This extends the passed in drawing options with the animation details.

Parameters:

NameTypeDescription
animAnimationThe animation with the cell details to be used.
optsDrawing OptionsThe existing options to extend.

Return Type: Drawing Options

Signatures:

drawing_options option_with_animation(animation anim, drawing_options opts)

Option With Bitmap Cell

Option With Bitmap Cell

When drawing the bitmap this will only draw the cell. To use this the bitmap needs to have been provided with its cell details (see Bitmap Set Cell Details). This option overrides the animation or part drawing options.

Parameters:

NameTypeDescription
cellIntegerThe cell to draw from the bitmap (-1 for entire bitmap)

Return Type: Drawing Options

Signatures:

drawing_options option_with_bitmap_cell(int cell)

Option With Bitmap Cell

When drawing the bitmap this will only draw the cell. To use this the bitmap needs to have been provided with its cell details (see Bitmap Set Cell Details). This option overrides the animation or part drawing options. This extends the passed in drawing options with the cell details.

Parameters:

NameTypeDescription
cellIntegerThe cell to draw from the bitmap (-1 for entire bitmap)
optsDrawing OptionsThe existing options to extend.

Return Type: Drawing Options

Signatures:

drawing_options option_with_bitmap_cell(int cell, drawing_options opts)

Draw Ellipse

Draw Ellipse

Draws an ellipse using the provided location, and size.

Parameters:

NameTypeDescription
clrColorThe color of the ellipse
rectRectangleIndicates the location and size of the ellipse

Signatures:

void draw_ellipse(color clr, const rectangle rect)

Draw Ellipse

Draws an ellipse using the provided location, size, and drawing options. At this stage ellipse drawing is not affected by line width from the drawing options.

Parameters:

NameTypeDescription
clrColorThe color of the ellipse
rectRectangleIndicates the location and size of the ellipse
optsDrawing OptionsThe drawing options

Signatures:

void draw_ellipse(color clr, const rectangle rect, drawing_options opts)

Draw Ellipse

Draws an ellipse using the provided location, and size.

Parameters:

NameTypeDescription
clrColorThe color of the ellipse
xDoubleThe distance from the left of the bitmap or window to the left edge of the ellipse
yDoubleThe distance from the top of the bitmap or window to the top edge of the ellipse
widthDoubleThe width of the ellipse
heightDoubleThe height of the ellipse

Signatures:

void draw_ellipse(color clr, double x, double y, double width, double height)

Draw Ellipse

Draws an ellipse using the provided location, size, and drawing options. At this stage ellipse drawing is not affected by line width from the drawing options.

Parameters:

NameTypeDescription
clrColorThe color of the ellipse
xDoubleThe distance from the left of the bitmap or window to the left edge of the ellipse
yDoubleThe distance from the top of the bitmap or window to the top edge of the ellipse
widthDoubleThe width of the ellipse
heightDoubleThe height of the ellipse
optsDrawing OptionsThe drawing options

Signatures:

void draw_ellipse(color clr, double x, double y, double width, double height, drawing_options opts)

Draw Ellipse On Bitmap

Draw Ellipse On Bitmap

Draws an ellipse on the given bitmap, using the provided location, and size.

Parameters:

NameTypeDescription
destinationBitmapthe bitmap to draw the ellipse on
clrColorThe color of the ellipse
rectRectangleIndicates the location and size of the ellipse

Signatures:

void draw_ellipse_on_bitmap(bitmap destination, color clr, const rectangle rect)

Draw Ellipse On Bitmap

Draws an ellipse on the given bitmap, using the provided location, size, and drawing options. At this stage ellipse drawing is not affected by line width from the drawing options.

Parameters:

NameTypeDescription
destinationBitmapthe bitmap to draw the ellipse on
clrColorThe color of the ellipse
rectRectangleIndicates the location and size of the ellipse
optsDrawing OptionsThe drawing options

Signatures:

void draw_ellipse_on_bitmap(bitmap destination, color clr, const rectangle rect, drawing_options opts)

Draw Ellipse On Bitmap

Draws an ellipse on the given bitmap, using the provided location, and size.

Parameters:

NameTypeDescription
destinationBitmapthe bitmap to draw the ellipse on
clrColorThe color of the ellipse
xDoubleThe distance from the left of the bitmap or bitmap to the left edge of the ellipse
yDoubleThe distance from the top of the bitmap or bitmap to the top edge of the ellipse
widthDoubleThe width of the ellipse
heightDoubleThe height of the ellipse

Signatures:

void draw_ellipse_on_bitmap(bitmap destination, color clr, double x, double y, double width, double height)

Draw Ellipse On Bitmap

Draws an ellipse to the bitmap, using the provided location, size, and drawing options. At this stage ellipse drawing is not affected by line width from the drawing options.

Parameters:

NameTypeDescription
destinationBitmapthe bitmap to draw the ellipse on
clrColorThe color of the ellipse
xDoubleThe distance from the left of the bitmap or bitmap to the left edge of the ellipse
yDoubleThe distance from the top of the bitmap or bitmap to the top edge of the ellipse
widthDoubleThe width of the ellipse
heightDoubleThe height of the ellipse
optsDrawing OptionsThe drawing options

Signatures:

void draw_ellipse_on_bitmap(bitmap destination, color clr, double x, double y, double width, double height, drawing_options opts)

Draw Ellipse On Window

Draw Ellipse On Window

Draws an ellipse on the given window, using the provided location, and size.

Parameters:

NameTypeDescription
destinationWindowthe window to draw the ellipse on
clrColorThe color of the ellipse
rectRectangleIndicates the location and size of the ellipse

Signatures:

void draw_ellipse_on_window(window destination, color clr, const rectangle rect)

Draw Ellipse On Window

Draws an ellipse on the given window, using the provided location, size, and drawing options. At this stage ellipse drawing is not affected by line width from the drawing options.

Parameters:

NameTypeDescription
destinationWindowthe window to draw the ellipse on
clrColorThe color of the ellipse
rectRectangleIndicates the location and size of the ellipse
optsDrawing OptionsThe drawing options

Signatures:

void draw_ellipse_on_window(window destination, color clr, const rectangle rect, drawing_options opts)

Draw Ellipse On Window

Draws an ellipse on the given window, using the provided location, and size.

Parameters:

NameTypeDescription
destinationWindowthe window to draw the ellipse on
clrColorThe color of the ellipse
xDoubleThe distance from the left of the bitmap or window to the left edge of the ellipse
yDoubleThe distance from the top of the bitmap or window to the top edge of the ellipse
widthDoubleThe width of the ellipse
heightDoubleThe height of the ellipse

Signatures:

void draw_ellipse_on_window(window destination, color clr, double x, double y, double width, double height)

Draw Ellipse On Window

Draws an ellipse to the window, using the provided location, size, and drawing options. At this stage ellipse drawing is not affected by line width from the drawing options.

Parameters:

NameTypeDescription
destinationWindowthe window to draw the ellipse on
clrColorThe color of the ellipse
xDoubleThe distance from the left of the bitmap or window to the left edge of the ellipse
yDoubleThe distance from the top of the bitmap or window to the top edge of the ellipse
widthDoubleThe width of the ellipse
heightDoubleThe height of the ellipse
optsDrawing OptionsThe drawing options

Signatures:

void draw_ellipse_on_window(window destination, color clr, double x, double y, double width, double height, drawing_options opts)

Fill Ellipse

Fill Ellipse

Fill an ellipse using the provided location, and size.

Parameters:

NameTypeDescription
clrColorThe color of the ellipse
rectRectangleIndicates the location and size of the ellipse

Signatures:

void fill_ellipse(color clr, const rectangle rect)

Fill Ellipse

Fills an ellipse using the provided location, size, and drawing options. At this stage ellipse drawing is not affected by line width from the drawing options.

Parameters:

NameTypeDescription
clrColorThe color of the ellipse
rectRectangleIndicates the location and size of the ellipse
optsDrawing OptionsThe drawing options

Signatures:

void fill_ellipse(color clr, const rectangle rect, drawing_options opts)

Fill Ellipse

Fills an ellipse using the provided location, and size.

Parameters:

NameTypeDescription
clrColorThe color of the ellipse
xDoubleThe distance from the left of the bitmap or window to the left edge of the ellipse
yDoubleThe distance from the top of the bitmap or window to the top edge of the ellipse
widthDoubleThe width of the ellipse
heightDoubleThe height of the ellipse

Signatures:

void fill_ellipse(color clr, double x, double y, double width, double height)

Fill Ellipse

Fills an ellipse using the provided location, size, and drawing options.

Parameters:

NameTypeDescription
clrColorThe color of the ellipse
xDoubleThe distance from the left of the bitmap or window to the left edge of the ellipse
yDoubleThe distance from the top of the bitmap or window to the top edge of the ellipse
widthDoubleThe width of the ellipse
heightDoubleThe height of the ellipse
optsDrawing OptionsThe drawing options

Signatures:

void fill_ellipse(color clr, double x, double y, double width, double height, drawing_options opts)

Fill Ellipse On Bitmap

Fill Ellipse On Bitmap

Fill an ellipse on the given bitmap, using the provided location, and size.

Parameters:

NameTypeDescription
destinationBitmapthe bitmap to draw the ellipse on
clrColorThe color of the ellipse
rectRectangleIndicates the location and size of the ellipse

Signatures:

void fill_ellipse_on_bitmap(bitmap destination, color clr, const rectangle rect)

Fill Ellipse On Bitmap

Fills an ellipse on the given bitmap, using the provided location, size, and drawing options. At this stage ellipse drawing is not affected by line width from the drawing options.

Parameters:

NameTypeDescription
destinationBitmapthe bitmap to draw the ellipse on
clrColorThe color of the ellipse
rectRectangleIndicates the location and size of the ellipse
optsDrawing OptionsThe drawing options

Signatures:

void fill_ellipse_on_bitmap(bitmap destination, color clr, const rectangle rect, drawing_options opts)

Fill Ellipse On Bitmap

Fills an ellipse on the given bitmap, using the provided location, and size.

Parameters:

NameTypeDescription
destinationBitmapthe bitmap to draw the ellipse on
clrColorThe color of the ellipse
xDoubleThe distance from the left of the bitmap or bitmap to the left edge of the ellipse
yDoubleThe distance from the top of the bitmap or bitmap to the top edge of the ellipse
widthDoubleThe width of the ellipse
heightDoubleThe height of the ellipse

Signatures:

void fill_ellipse_on_bitmap(bitmap destination, color clr, double x, double y, double width, double height)

Fill Ellipse On Bitmap

Fills an ellipse on the given bitmap, using the provided location, size, and drawing options.

Parameters:

NameTypeDescription
destinationBitmapthe bitmap to draw the ellipse on
clrColorThe color of the ellipse
xDoubleThe distance from the left of the bitmap or bitmap to the left edge of the ellipse
yDoubleThe distance from the top of the bitmap or bitmap to the top edge of the ellipse
widthDoubleThe width of the ellipse
heightDoubleThe height of the ellipse
optsDrawing OptionsThe drawing options

Signatures:

void fill_ellipse_on_bitmap(bitmap destination, color clr, double x, double y, double width, double height, drawing_options opts)

Fill Ellipse On Window

Fill Ellipse On Window

Fill an ellipse on the given window, using the provided location, and size.

Parameters:

NameTypeDescription
destinationWindowthe window to draw the ellipse on
clrColorThe color of the ellipse
rectRectangleIndicates the location and size of the ellipse

Signatures:

void fill_ellipse_on_window(window destination, color clr, const rectangle rect)

Fill Ellipse On Window

Fills an ellipse on the given window, using the provided location, size, and drawing options. At this stage ellipse drawing is not affected by line width from the drawing options.

Parameters:

NameTypeDescription
destinationWindowthe window to draw the ellipse on
clrColorThe color of the ellipse
rectRectangleIndicates the location and size of the ellipse
optsDrawing OptionsThe drawing options

Signatures:

void fill_ellipse_on_window(window destination, color clr, const rectangle rect, drawing_options opts)

Fill Ellipse On Window

Fills an ellipse on the given window, using the provided location, and size.

Parameters:

NameTypeDescription
destinationWindowthe window to draw the ellipse on
clrColorThe color of the ellipse
xDoubleThe distance from the left of the bitmap or window to the left edge of the ellipse
yDoubleThe distance from the top of the bitmap or window to the top edge of the ellipse
widthDoubleThe width of the ellipse
heightDoubleThe height of the ellipse

Signatures:

void fill_ellipse_on_window(window destination, color clr, double x, double y, double width, double height)

Fill Ellipse On Window

Fills an ellipse on the given window, using the provided location, size, and drawing options.

Parameters:

NameTypeDescription
destinationWindowthe window to draw the ellipse on
clrColorThe color of the ellipse
xDoubleThe distance from the left of the bitmap or window to the left edge of the ellipse
yDoubleThe distance from the top of the bitmap or window to the top edge of the ellipse
widthDoubleThe width of the ellipse
heightDoubleThe height of the ellipse
optsDrawing OptionsThe drawing options

Signatures:

void fill_ellipse_on_window(window destination, color clr, double x, double y, double width, double height, drawing_options opts)

Clear Screen

Clear Screen

Clears the current screen to color white.

Signatures:

void clear_screen()

Clear Screen

Parameters:

NameTypeDescription
clrColorThe color to clear the screen’s background color to.

Signatures:

void clear_screen(color clr)

Display Details

Returns the details about one of the displays attached to the computer.

Parameters:

NameTypeDescription
indexunsigned intThe display number (from 0 to Number Of Displays - 1)

Return Type: Display

Signatures:

display display_details(unsigned int index)

Display Height

Return the height of the display in pixels, read from the system details.

Parameters:

NameTypeDescription
dispDisplayThe display details

Return Type: Integer

Signatures:

int display_height(display disp)

Display Name

Return the name of the display, read from the system details.

Parameters:

NameTypeDescription
dispDisplayThe display details

Return Type: String

Signatures:

string display_name(display disp)

Display Width

Return the width of the display in pixels, read from the system details.

Parameters:

NameTypeDescription
dispDisplayThe display details

Return Type: Integer

Signatures:

int display_width(display disp)

Display X

Return a relative x location for the display in pixels, read from the system details. This can be used to work out the arrangement of displays.

Parameters:

NameTypeDescription
dispDisplayThe display details

Return Type: Integer

Signatures:

int display_x(display disp)

Display Y

Return a relative y location for the display in pixels, read from the system details. This can be used to work out the arrangement of displays.

Parameters:

NameTypeDescription
dispDisplayThe display details

Return Type: Integer

Signatures:

int display_y(display disp)

Number Of Displays

Returns the number of physical displays attached to the computer.

Return Type: Integer

Signatures:

int number_of_displays()

Refresh Screen

Refresh Screen

Signatures:

void refresh_screen()

Refresh Screen

Refreshes all open windows with a target FPS (frames per second). This will delay a period of time that will approximately meet the targeted frames per second.

Parameters:

NameTypeDescription
target_fpsunsigned intThe targeted frames per second to refresh the screen at.

Signatures:

void refresh_screen(unsigned int target_fps)

Save Bitmap

Save the bitmap to the user’s desktop.

Parameters:

NameTypeDescription
bmpBitmapThe bitmap to save
basenameStringThe base of the filename. If there is a file of this name already, then the name will be changed to generate a unique filename.

Signatures:

void save_bitmap(bitmap bmp, const string &basename)

Screen Height

Returns the height of the current window.

Return Type: Integer

Signatures:

int screen_height()

Screen Width

Returns the width of the current window.

Return Type: Integer

Signatures:

int screen_width()

Take Screenshot

Take Screenshot

Saves a screenshot of the current window to a bitmap file. The file will be saved onto the user’s desktop.

Parameters:

NameTypeDescription
basenameStringThe base of the filename. If there is a file of this name already, then the name will be changed to generate a unique filename.

Signatures:

void take_screenshot(const string &basename)

Take Screenshot

Saves a screenshot of the current window to a bitmap file. The file will be saved onto the user’s desktop.

Parameters:

NameTypeDescription
windWindowThe window to capture in the screenshot
basenameStringThe base of the filename. If there is a file of this name already, then the name will be changed to generate a unique filename.

Signatures:

void take_screenshot(window wind, const string &basename)

Bitmap Bounding Circle

Returns a circle that will encompass the entire bitamp.

Parameters:

NameTypeDescription
bmpBitmapThe bitmap to encompass.
ptPoint 2dThe point where the bitmap is located.

Return Type: Circle

Signatures:

circle bitmap_bounding_circle(bitmap bmp, const point_2d &pt)

Bitmap Bounding Rectangle

Bitmap Bounding Rectangle

Returns a rectangle that is the same size as a bitmap (the whole bitmap).

Parameters:

NameTypeDescription
bmpBitmapThe bitmap

Return Type: Rectangle

Signatures:

rectangle bitmap_bounding_rectangle(bitmap bmp)

Bitmap Bounding Rectangle

Returns a rectangle that is the same size as the bitmap and is located at the indicated position.

Parameters:

NameTypeDescription
bmpBitmapThe bitmap
xDoubleThe x location of the rectangle
yDoubleThe y location of the rectangle

Return Type: Rectangle

Signatures:

rectangle bitmap_bounding_rectangle(bitmap bmp, double x, double y)

Bitmap Cell Center

This returns a point that represents the center of a cell from this bitmap in local space.

Parameters:

NameTypeDescription
bmpBitmapThe bitmap to get the center of.

Return Type: Point 2d

Signatures:

point_2d bitmap_cell_center(bitmap bmp)

Bitmap Cell Circle

Bitmap Cell Circle

Returns a circle that will encompass the bitmap cell if it were drawn at the indicated point.

Parameters:

NameTypeDescription
bmpBitmapThe bitmap to get the details from.
xDoubleThe the x location of the bitmap.
yDoubleThe the y location of the bitmap.

Return Type: Circle

Signatures:

circle bitmap_cell_circle(bitmap bmp, double x, double y)

Bitmap Cell Circle

Returns a circle that will encompass the bitmap cell if it were drawn at the indicated point.

Parameters:

NameTypeDescription
bmpBitmapThe bitmap to get the details from.
ptPoint 2dThe point indicating the location of the bitmap.

Return Type: Circle

Signatures:

circle bitmap_cell_circle(bitmap bmp, const point_2d pt)

Bitmap Cell Circle

Returns a circle that will encompass the bitmap cell if it were drawn at the indicated point, with the provided scale.

Parameters:

NameTypeDescription
bmpBitmapThe bitmap to get the details from.
ptPoint 2dThe point indicating the location of the bitmap.
scaleDoubleThe scaling factor for the bitmap drawing.

Return Type: Circle

Signatures:

circle bitmap_cell_circle(bitmap bmp, const point_2d pt, double scale)

Bitmap Cell Columns

Returns the number of cell columns in the bitmap. This is setup using Bitmap Set Cell Details

Parameters:

NameTypeDescription
bmpBitmapThe bitmap to check

Return Type: Integer

Signatures:

int bitmap_cell_columns(bitmap bmp)

Bitmap Cell Count

Returns the number of cells within the bitmap.

Parameters:

NameTypeDescription
bmpBitmapThe bitmap to check.

Return Type: Integer

Signatures:

int bitmap_cell_count(bitmap bmp)

Bitmap Cell Height

Returns the height of each cell in this bitmap.

Parameters:

NameTypeDescription
bmpBitmapThe bitmap to get the details from.

Return Type: Integer

Signatures:

int bitmap_cell_height(bitmap bmp)

Bitmap Cell Offset

Returns a vector that represents the movement needed to get to a given cell within a bitmap.

Parameters:

NameTypeDescription
srcBitmapThe bitmap with the cell details.
cellIntegerThe index of the cell

Return Type: Vector 2d

Signatures:

vector_2d bitmap_cell_offset(bitmap src, int cell)

Bitmap Cell Rectangle

Bitmap Cell Rectangle

Returns a rectangle that will encompass a cell of the bitmap.

Parameters:

NameTypeDescription
srcBitmapThe bitmap to get the details from

Return Type: Rectangle

Signatures:

rectangle bitmap_cell_rectangle(bitmap src)

Bitmap Cell Rectangle

Returns a rectangle that will encompass the bitmap cell if it were drawn at the indicated point.

Parameters:

NameTypeDescription
srcBitmapThe bitmap to get the details from
ptPoint 2dThe point details for the rectangle.

Return Type: Rectangle

Signatures:

rectangle bitmap_cell_rectangle(bitmap src, const point_2d &pt)

Bitmap Cell Rows

Returns the number of rows of cells in the bitmap. These details are set in Bitmap Set Cell Details.

Parameters:

NameTypeDescription
bmpBitmapThe bitmap to get the details from.

Return Type: Integer

Signatures:

int bitmap_cell_rows(bitmap bmp)

Bitmap Cell Width

Returns the width of each cell in this bitmap.

Parameters:

NameTypeDescription
bmpBitmapThe bitmap to get the details from.

Return Type: Integer

Signatures:

int bitmap_cell_width(bitmap bmp)

Bitmap Center

This returns a point that represents the center of the bitmap in local space.

Parameters:

NameTypeDescription
bmpBitmapThe bitmap to get the center of.

Return Type: Point 2d

Signatures:

point_2d bitmap_center(bitmap bmp)

Bitmap Filename

Returns the filename from which the bitmap was loaded. This will be an empty string for created bitmaps.

Parameters:

NameTypeDescription
bmpBitmapThe bitmap to get the filename from.

Return Type: String

Signatures:

string bitmap_filename(bitmap bmp)

Bitmap Height

Bitmap Height

Returns the total height of the bitmap. If the bitmap contains cells, you ca get the height of a cell using Bitmap Cell Height.

Parameters:

NameTypeDescription
bmpBitmapThe bitmap to get the details from.

Return Type: Integer

Signatures:

int bitmap_height(bitmap bmp)

Bitmap Height

Returns the total height of the bitmap. If the bitmap contains cells, you ca get the height of a cell using Bitmap Cell Height.

Parameters:

NameTypeDescription
nameStringThe name of the bitmap to get the details from.

Return Type: Integer

Signatures:

int bitmap_height(string name)

Bitmap Name

Returns the name of the bitmap was loaded. This is the name you can use to access this bitmap.

Parameters:

NameTypeDescription
bmpBitmapThe bitmap to get the name from.

Return Type: String

Signatures:

string bitmap_name(bitmap bmp)

Bitmap Named

Returns the Bitmap that has been loaded with the specified name, see Load Bitmap. This will attempt to load the bitmap if it has not been loaded.

Parameters:

NameTypeDescription
nameStringThe name of the bitmap to check.

Return Type: Bitmap

Signatures:

bitmap bitmap_named(string name)

Bitmap Rectangle Of Cell

Returns a rectangle that can be used to access the part of a bitmap related to an individual cell.

Parameters:

NameTypeDescription
srcBitmapThe bitmap
cellIntegerThe cell

Return Type: Rectangle

Signatures:

rectangle bitmap_rectangle_of_cell(bitmap src, int cell)

Bitmap Set Cell Details

Initialise the bitmap cell details. This allows parts of the bitmap to be drawn as individual cells.

Parameters:

NameTypeDescription
bmpBitmapThe bitmap
widthIntegerThe width of each cell
heightIntegerThe height of each cell
columnsIntegerThe number of cell columns within the bitmap
rowsIntegerThe number of cell rows within the bitmap
countIntegerThe total number of cells, may be fewer than columns * rows

Signatures:

void bitmap_set_cell_details(bitmap bmp, int width, int height, int columns, int rows, int count)

Bitmap Valid

Lets you test if bitmap value is valid. This will return true when it is a valid bitmap.

Parameters:

NameTypeDescription
bmpBitmapthe bitmap to test

Return Type: Boolean

Signatures:

bool bitmap_valid(bitmap bmp)

Bitmap Width

Bitmap Width

Returns the width of the bitmap.

Parameters:

NameTypeDescription
bmpBitmapThe bitmap

Return Type: Integer

Signatures:

int bitmap_width(bitmap bmp)

Bitmap Width

Returns the width of the bitmap.

Parameters:

NameTypeDescription
nameStringThe name of the bitmap

Return Type: Integer

Signatures:

int bitmap_width(string name)

Clear Bitmap

Clear Bitmap

Clear the bitmap to the indicated color. This will ensure the entire surface of the bitmap is set to that color.

Parameters:

NameTypeDescription
bmpBitmapThe bitmap
clrColorThe new color for the surface of the bitmap

Signatures:

void clear_bitmap(bitmap bmp, color clr)

Clear Bitmap

Clear the bitmap to the indicated color. This will ensure the entire surface of the bitmap is set to that color.

Parameters:

NameTypeDescription
nameStringThe name of the bitmap
clrColorThe new color for the surface of the bitmap

Signatures:

void clear_bitmap(string name, color clr)

Create Bitmap

Creates a new bitmap that you can draw to. Initially the bitmap will be transparent.

Parameters:

NameTypeDescription
nameStringThe name of the bitmap resource to be created. If this already exists SplashKit will alter the name to make it unique.
widthIntegerThe width of the created bitmap
heightIntegerThe height of the created bitmap

Return Type: Bitmap

Signatures:

bitmap create_bitmap(string name, int width, int height)

Draw Bitmap

Draw Bitmap

Draws the bitmap supplied into bmp to the current window. at x and y.

Parameters:

NameTypeDescription
bmpBitmapthe bitmap which will be drawn to the screen
xDoublethe x location which represents where the bitmap will be drawn
yDoublethe y location which represents where the bitmap will be drawn

Signatures:

void draw_bitmap(bitmap bmp, double x, double y)

Draw Bitmap

Draws the bitmap supplied into bmp to the current window. with extra drawing options supplied in opts at x and y.

Parameters:

NameTypeDescription
bmpBitmapthe bitmap which will be drawn to the screen
xDoublethe x location which represents where the bitmap will be drawn
yDoublethe y location which represents where the bitmap will be drawn
optsDrawing Optionsthe Drawing Options which provide extra information for how to draw the Bitmap

Signatures:

void draw_bitmap(bitmap bmp, double x, double y, drawing_options opts)

Draw Bitmap

Searches and draws a bitmap with name name to the current window. with extra drawing options supplied in opts at x and y.

Parameters:

NameTypeDescription
nameStringthe name of the bitmap which will be drawn to the screen
xDoublethe x location which represents where the bitmap will be drawn
yDoublethe y location which represents where the bitmap will be drawn

Signatures:

void draw_bitmap(string name, double x, double y)

Draw Bitmap

Searches and draws a bitmap with name name to the current window. with extra drawing options supplied in opts at x and y.

Parameters:

NameTypeDescription
nameStringthe name of the bitmap which will be drawn to the screen
xDoublethe x location which represents where the bitmap will be drawn
yDoublethe y location which represents where the bitmap will be drawn
optsDrawing Optionsthe Drawing Options which provide extra information for how to draw the Bitmap

Signatures:

void draw_bitmap(string name, double x, double y, drawing_options opts)

Draw Bitmap On Bitmap

Draw Bitmap On Bitmap

Draws the bitmap supplied into bmp to the given bitmap. at x and y.

Parameters:

NameTypeDescription
destinationBitmapthe bitmap to draw the bitmap to
bmpBitmapthe bitmap which will be drawn to the screen
xDoublethe x location which represents where the bitmap will be drawn
yDoublethe y location which represents where the bitmap will be drawn

Signatures:

void draw_bitmap_on_bitmap(bitmap destination, bitmap bmp, double x, double y)

Draw Bitmap On Bitmap

Draws the bitmap supplied into bmp to the given bitmap. with extra drawing options supplied in opts at x and y.

Parameters:

NameTypeDescription
destinationBitmapthe bitmap to draw the bitmap to
bmpBitmapthe bitmap which will be drawn to the screen
xDoublethe x location which represents where the bitmap will be drawn
yDoublethe y location which represents where the bitmap will be drawn
optsDrawing Optionsthe Drawing Options which provide extra information for how to draw the Bitmap

Signatures:

void draw_bitmap_on_bitmap(bitmap destination, bitmap bmp, double x, double y, drawing_options opts)

Draw Bitmap On Window

Draw Bitmap On Window

Draws the bitmap supplied into bmp to the given window. at x and y.

Parameters:

NameTypeDescription
destinationWindowthe window to draw the bitmap to
bmpBitmapthe bitmap which will be drawn to the screen
xDoublethe x location which represents where the bitmap will be drawn
yDoublethe y location which represents where the bitmap will be drawn

Signatures:

void draw_bitmap_on_window(window destination, bitmap bmp, double x, double y)

Draw Bitmap On Window

Draws the bitmap supplied into bmp to the given window. with extra drawing options supplied in opts at x and y.

Parameters:

NameTypeDescription
destinationWindowthe window to draw the bitmap to
bmpBitmapthe bitmap which will be drawn to the screen
xDoublethe x location which represents where the bitmap will be drawn
yDoublethe y location which represents where the bitmap will be drawn
optsDrawing Optionsthe Drawing Options which provide extra information for how to draw the Bitmap

Signatures:

void draw_bitmap_on_window(window destination, bitmap bmp, double x, double y, drawing_options opts)