Skip to content

Windows

Functions

Clear Window

clears a window to the specified color given in clr

Parameters:

NameTypeDescription
windWindowthe Window to clear
clrColorthe Color to clear the window to.

Signatures:

void clear_window(window wind, color clr)

Close All Windows

Releases all of the windows which have been loaded.

Signatures:

void close_all_windows()

Close Current Window

Closes and frees the current window.

Signatures:

void close_current_window()

Close Window

Close Window

Closes and frees the graphics window identified by name.

Parameters:

NameTypeDescription
nameStringThe name (caption) of the window to close

Signatures:

void close_window(const string &name)

Close Window

Closes and frees the graphics window supplied in wind.

Parameters:

NameTypeDescription
windWindowThe window to close

Signatures:

void close_window(window wind)

Current Window

Returns the window that you are currently interacting with. This will be the default window for drawing options, and events.

Return Type: Window

Signatures:

window current_window()

Current Window Has Border

Indicate if the current window has a border.

Return Type: Boolean

Signatures:

bool current_window_has_border()

Current Window Height

Returns the height of the current window.

Return Type: Integer

Signatures:

int current_window_height()

Current Window Is Fullscreen

Is the current window currently fullscreen?

Return Type: Boolean

Signatures:

bool current_window_is_fullscreen()

Current Window Position

The location of the current window.

Return Type: Point 2d

Signatures:

point_2d current_window_position()

Current Window Toggle Border

Toggle the current window border.

Signatures:

void current_window_toggle_border()

Current Window Toggle Fullscreen

Toggle the fullscreen property of the current window

Signatures:

void current_window_toggle_fullscreen()

Current Window Width

Returns the width of the current window.

Return Type: Integer

Signatures:

int current_window_width()

Current Window X

The x location of the current window on the displays.

Return Type: Integer

Signatures:

int current_window_x()

Current Window Y

The y location of the current window on the displays.

Return Type: Integer

Signatures:

int current_window_y()

Has Window

Determines if SplashKit has a window loaded with the supplied name. This checks against all windows loaded, those loaded without a name are assigned the filename as a default. If this returns false, you may want to use load_window to load in a specific window and give it the desired name.

Parameters:

NameTypeDescription
captionStringThe name of the window to check for.

Return Type: Boolean

Signatures:

bool has_window(string caption)

Is Current Window

Check if the requested window is the current window.

Parameters:

NameTypeDescription
windWindowThe window to check

Return Type: Boolean

Signatures:

bool is_current_window(window wind)

Move Current Window To

Move the current window to the new location on the displays.

Parameters:

NameTypeDescription
xIntegerThe new x location
yIntegerThe new y location

Signatures:

void move_current_window_to(int x, int y)

Move Window To

Move Window To

Move the window to the new location on the displays.

Parameters:

NameTypeDescription
nameStringThe name of the window to move
xIntegerThe new x location
yIntegerThe new y location

Signatures:

void move_window_to(const string &name, int x, int y)

Move Window To

Move the window to the new location on the displays.

Parameters:

NameTypeDescription
windWindowthe window to move.
xIntegerThe new x location
yIntegerThe new y location

Signatures:

void move_window_to(window wind, int x, int y)

Open Window

Opens a new graphics window. The supplied caption is used to name and identify the window. The supplied width and height indicate the size of the window. The window can be retrieved by passing caption to the Window Named function.

Parameters:

NameTypeDescription
captionStringThe title of the window. If a window with this caption already exists, SplashKit will alter the caption to ensure that it is unique.
widthIntegerThe width of the window
heightIntegerThe height of the window

Return Type: Window

Signatures:

window open_window(string caption, int width, int height)

Refresh Window

Refresh Window

Refreshes the window wind.

Parameters:

NameTypeDescription
windWindowthe Window to refresh.

Signatures:

void refresh_window(window wind)

Refresh Window

Refreshes the window wind.

Parameters:

NameTypeDescription
windWindowthe Window to refresh.
target_fpsunsigned intthe desired framerate

Signatures:

void refresh_window(window wind, unsigned int target_fps)

Resize Current Window

Change the size of the current window.

Parameters:

NameTypeDescription
widthIntegerIts new width
heightIntegerIts new height

Signatures:

void resize_current_window(int width, int height)

Resize Window

Change the size of the window.

Parameters:

NameTypeDescription
wndWindowThe window to change.
widthIntegerIts new width
heightIntegerIts new height

Signatures:

void resize_window(window wnd, int width, int height)

Set Current Window

Set Current Window

Set the current window to the window with the supplied caption.

Parameters:

NameTypeDescription
nameStringThe caption of the new current window.

Signatures:

void set_current_window(const string &name)

Set Current Window

Change the current window. Use this so that you can draw to different windows by default.

Parameters:

NameTypeDescription
windWindowThe new current window

Signatures:

void set_current_window(window wind)

Window Caption

The caption of the window.

Parameters:

NameTypeDescription
windWindowThe window

Return Type: String

Signatures:

string window_caption(window wind)

Window Close Requested

Window Close Requested

Checks all opened windows in the current program to determin if a window with the name name is currently open, and will close a window if one is found.

Parameters:

NameTypeDescription
nameStringThe name of the window to close

Return Type: Boolean

Signatures:

bool window_close_requested(const string &name)

Window Close Requested

Closes the window given in wind

Parameters:

NameTypeDescription
windWindowthe Window to be closed

Return Type: Boolean

Signatures:

bool window_close_requested(window wind)

Window Has Border

Window Has Border

Indicate if the window has a border.

Parameters:

NameTypeDescription
nameStringThe name of the window

Return Type: Boolean

Signatures:

bool window_has_border(const string &name)

Window Has Border

Indicate if the window has a border.

Parameters:

NameTypeDescription
wndWindowThe window

Return Type: Boolean

Signatures:

bool window_has_border(window wnd)

Window Has Focus

Indicates if the window has focus.

Parameters:

NameTypeDescription
windWindowThe window

Return Type: Boolean

Signatures:

bool window_has_focus(window wind)

Window Height

Window Height

Returns the height of the window with the indicated name in pixels.

Parameters:

NameTypeDescription
nameStringThe name of the window

Return Type: Integer

Signatures:

int window_height(const string &name)

Window Height

Returns the height of the window in pixels.

Parameters:

NameTypeDescription
windWindowThe window

Return Type: Integer

Signatures:

int window_height(window wind)

Window Is Fullscreen

Window Is Fullscreen

Is the window currently fullscreen?

Parameters:

NameTypeDescription
nameStringThe name of the window to check

Return Type: Boolean

Signatures:

bool window_is_fullscreen(const string &name)

Window Is Fullscreen

Is the window currently fullscreen?

Parameters:

NameTypeDescription
wndWindowThe window to check

Return Type: Boolean

Signatures:

bool window_is_fullscreen(window wnd)

Window Named

Returns an opened Window with the given name caption, if a window with name caption is found.

Parameters:

NameTypeDescription
captionStringthe String name of the window.

Return Type: Window

Signatures:

window window_named(string caption)

Window Position

Window Position

The location of the window.

Parameters:

NameTypeDescription
nameStringThe name of the window.

Return Type: Point 2d

Signatures:

point_2d window_position(const string &name)

Window Position

The location of the window.

Parameters:

NameTypeDescription
wndWindowThe window.

Return Type: Point 2d

Signatures:

point_2d window_position(window wnd)

Window Set Icon

Sets the icon of the current window.

Parameters:

NameTypeDescription
windWindowThe window to change the icon of
bmpBitmapThe image with the details to show in the icon

Signatures:

void window_set_icon(window wind, bitmap bmp)

Window Toggle Border

Window Toggle Border

Toggle the window border.

Parameters:

NameTypeDescription
nameStringThe name of the window to change

Signatures:

void window_toggle_border(const string &name)

Window Toggle Border

Toggle the window border.

Parameters:

NameTypeDescription
wndWindowThe window to change

Signatures:

void window_toggle_border(window wnd)

Window Toggle Fullscreen

Window Toggle Fullscreen

Toggle the fullscreen property of the window

Parameters:

NameTypeDescription
nameStringThe name of the window to change

Signatures:

void window_toggle_fullscreen(const string &name)

Window Toggle Fullscreen

Toggle the fullscreen property of the window

Parameters:

NameTypeDescription
wndWindowThe window to change

Signatures:

void window_toggle_fullscreen(window wnd)

Window Width

Window Width

Returns the width of the window with the indicated name in pixels.

Parameters:

NameTypeDescription
nameStringThe name of the window

Return Type: Integer

Signatures:

int window_width(const string &name)

Window Width

Returns the width of the window in pixels.

Parameters:

NameTypeDescription
windWindowThe window

Return Type: Integer

Signatures:

int window_width(window wind)

Window With Focus

Returns the window that the user currently has selected. This may be different to the current window.

Return Type: Window

Signatures:

window window_with_focus()

Window X

Window X

The x location of the window on the displays.

Parameters:

NameTypeDescription
nameStringThe name of the window

Return Type: Integer

Signatures:

int window_x(const string &name)

Window X

The x location of the window on the displays.

Parameters:

NameTypeDescription
wndWindowThe window

Return Type: Integer

Signatures:

int window_x(window wnd)

Window Y

Window Y

The y location of the window on the displays.

Parameters:

NameTypeDescription
nameStringThe name of the window

Return Type: Integer

Signatures:

int window_y(const string &name)

Window Y

The y location of the window on the displays.

Parameters:

NameTypeDescription
wndWindowThe window

Return Type: Integer

Signatures:

int window_y(window wnd)

Types

Window

The Window type is used to refer to a window that you have opened in SplashKit. You create new Windows using Open Window and they can be closed using Close Window.

  • opened with Open Window

  • and must be released using Close Window (to close a specific window) or delete_all_windows (to close all loaded windows).