Interface
Functions
Add Column
Adds a column to the current layout with width width
. - Positive values of width just specify the width in pixels. - 0 means use the default control width - not always a good choice. - Negative values specify filling to the right until width + 1
pixels away from the edge. - e.g -1 fills entirely to the right, while -20 leaves a 19 pixel gap on the right.
Parameters:
Name | Type | Description |
---|---|---|
width | Integer | Width of the column in pixels |
Signatures:
void add_column(int width)
public static void SplashKit.AddColumn(int width);
def add_column(width):
procedure AddColumn(width: Integer)
Add Column Relative
Adds a column to the current layout with width width
percentage of the container’s width.
Parameters:
Name | Type | Description |
---|---|---|
width | Double | Percentage of the container’s width (between 0 and 1) |
Signatures:
void add_column_relative(double width)
public static void SplashKit.AddColumnRelative(double width);
def add_column_relative(width):
procedure AddColumnRelative(width: Double)
Bitmap Button
Bitmap Button
Creates a button with a bitmap in it, and no label. Returns whether the button was clicked.
Parameters:
Name | Type | Description |
---|---|---|
bmp | Bitmap | The bitmap to show inside the button |
Return Type: Boolean
Signatures:
bool bitmap_button(bitmap bmp)
public static bool SplashKit.BitmapButton(Bitmap bmp);
def bitmap_button(bmp):
function BitmapButton(bmp: Bitmap): Boolean
Bitmap Button
Creates a button with a bitmap in it at a specific position on screen. Returns whether the button was clicked.
Parameters:
Name | Type | Description |
---|---|---|
bmp | Bitmap | The bitmap to show inside the button |
rect | Rectangle | The rectangle to display the button in |
Return Type: Boolean
Signatures:
bool bitmap_button(bitmap bmp, const rectangle &rect)
public static bool SplashKit.BitmapButton(Bitmap bmp, Rectangle rect);
def bitmap_button_at_position(bmp, rect):
function BitmapButton(bmp: Bitmap; const rect: Rectangle): Boolean
Bitmap Button
Creates a button with a bitmap in it at a specific position on screen. Returns whether the button was clicked.
Parameters:
Name | Type | Description |
---|---|---|
bmp | Bitmap | The bitmap to show inside the button |
rect | Rectangle | The rectangle to display the button in |
opts | Drawing Options | The drawing options |
Return Type: Boolean
Signatures:
bool bitmap_button(bitmap bmp, const rectangle &rect, drawing_options opts)
public static bool SplashKit.BitmapButton(Bitmap bmp, Rectangle rect, DrawingOptions opts);
def bitmap_button_at_position_with_options(bmp, rect, opts):
function BitmapButton(bmp: Bitmap; const rect: Rectangle; opts: DrawingOptions): Boolean
Bitmap Button
Creates a button with a bitmap in it, and no label. Returns whether the button was clicked.
Parameters:
Name | Type | Description |
---|---|---|
bmp | Bitmap | The bitmap to show inside the button |
opts | Drawing Options | The drawing options |
Return Type: Boolean
Signatures:
bool bitmap_button(bitmap bmp, drawing_options opts)
public static bool SplashKit.BitmapButton(Bitmap bmp, DrawingOptions opts);
def bitmap_button_with_options(bmp, opts):
function BitmapButton(bmp: Bitmap; opts: DrawingOptions): Boolean
Bitmap Button
Creates a button with a bitmap in it and a label. Returns whether the button was clicked.
Parameters:
Name | Type | Description |
---|---|---|
label_text | String | The label to show in front of the button |
bmp | Bitmap | The bitmap to show inside the button |
Return Type: Boolean
Signatures:
bool bitmap_button(const string &label_text, bitmap bmp)
public static bool SplashKit.BitmapButton(string labelText, Bitmap bmp);
def bitmap_button_labeled(label_text, bmp):
function BitmapButton(const labelText: String; bmp: Bitmap): Boolean
Bitmap Button
Creates a button with a bitmap in it and a label. Returns whether the button was clicked.
Parameters:
Name | Type | Description |
---|---|---|
label_text | String | The label to show in front of the button |
bmp | Bitmap | The bitmap to show inside the button |
opts | Drawing Options | The drawing options |
Return Type: Boolean
Signatures:
bool bitmap_button(const string &label_text, bitmap bmp, drawing_options opts)
public static bool SplashKit.BitmapButton(string labelText, Bitmap bmp, DrawingOptions opts);
def bitmap_button_labeled_with_options(label_text, bmp, opts):
function BitmapButton(const labelText: String; bmp: Bitmap; opts: DrawingOptions): Boolean
Button
Button
Creates a button at a specific position on screen. Returns whether the button was clicked.
Parameters:
Name | Type | Description |
---|---|---|
text | String | The text to show inside the button |
rect | Rectangle | The rectangle to display the button in |
Return Type: Boolean
Signatures:
bool button(const string &text, const rectangle &rect)
public static bool SplashKit.Button(string text, Rectangle rect);
def button_at_position(text, rect):
function Button(const text: String; const rect: Rectangle): Boolean
Usage:
Button
Creates a button without a label. Returns whether the button was clicked.
Parameters:
Name | Type | Description |
---|---|---|
text | String | The text to show inside the button |
Return Type: Boolean
Signatures:
bool button(const string &text)
public static bool SplashKit.Button(string text);
def button(text):
function Button(const text: String): Boolean
Button
Creates a button with a label. Returns whether the button was clicked. Example usage: c++ // Test if clicked: if (button("Button 1", "Click me!")) { // do stuff.. }
Parameters:
Name | Type | Description |
---|---|---|
label_text | String | The label to show in front of the button |
text | String | The text to show inside the button |
Return Type: Boolean
Signatures:
bool button(const string &label_text, const string &text)
public static bool SplashKit.Button(string labelText, string text);
def button_labeled(label_text, text):
function Button(const labelText: String; const text: String): Boolean
Checkbox
Checkbox
Creates a checkbox at a specific position on screen. Returns the updated value of the checkbox.
Parameters:
Name | Type | Description |
---|---|---|
text | String | The text to show next to the checkbox |
value | Boolean | The current value of the checkbox |
rect | Rectangle | The rectangle to display the checkbox in |
Return Type: Boolean
Signatures:
bool checkbox(const string &text, const bool &value, const rectangle &rect)
public static bool SplashKit.Checkbox(string text, bool value, Rectangle rect);
def checkbox_at_position(text, value, rect):
function Checkbox(const text: String; const value: Boolean; const rect: Rectangle): Boolean
Checkbox
Creates a checkbox. Returns the updated value of the checkbox.
Parameters:
Name | Type | Description |
---|---|---|
text | String | The text to show next to the checkbox |
value | Boolean | The current value of the checkbox |
Return Type: Boolean
Signatures:
bool checkbox(const string &text, const bool &value)
public static bool SplashKit.Checkbox(string text, bool value);
def checkbox(text, value):
function Checkbox(const text: String; const value: Boolean): Boolean
Checkbox
Creates a checkbox with a label. Returns the updated value of the checkbox. Example usage: c++ my_bool = checkbox("Checkbox 1", "Enabled?", my_bool);
Parameters:
Name | Type | Description |
---|---|---|
label_text | String | The label to show in front of the checkbox |
text | String | The text to show next to the checkbox |
value | Boolean | The current value of the checkbox |
Return Type: Boolean
Signatures:
bool checkbox(const string &label_text, const string &text, const bool &value)
public static bool SplashKit.Checkbox(string labelText, string text, bool value);
def checkbox_labeled(label_text, text, value):
function Checkbox(const labelText: String; const text: String; const value: Boolean): Boolean
Color Slider
Color Slider
Creates a set of RGBA sliders to adjust a color, at a specific position on screen. Returns the updated color value of the slider.
Parameters:
Name | Type | Description |
---|---|---|
clr | Color | The current value of the color slider |
rect | Rectangle | The rectangle to display the slider in. |
Return Type: Color
Signatures:
color color_slider(const color &clr, const rectangle &rect)
public static Color SplashKit.ColorSlider(Color clr, Rectangle rect);
def color_slider_at_position(clr, rect):
function ColorSlider(const clr: Color; const rect: Rectangle): Color
Color Slider
Creates a set of RGBA sliders to adjust a color. Returns the updated color value of the slider.
Parameters:
Name | Type | Description |
---|---|---|
clr | Color | The current value of the color slider |
Return Type: Color
Signatures:
color color_slider(const color &clr)
public static Color SplashKit.ColorSlider(Color clr);
def color_slider(clr):
function ColorSlider(const clr: Color): Color
Color Slider
Creates a set of RGBA sliders to adjust a color, with a label. Returns the updated color value of the slider. Example usage: c++ my_color = color_slider("Player Color", my_color);
Parameters:
Name | Type | Description |
---|---|---|
label_text | String | The label to show in front of the slider |
clr | Color | The current value of the color slider |
Return Type: Color
Signatures:
color color_slider(const string &label_text, const color &clr)
public static Color SplashKit.ColorSlider(string labelText, Color clr);
def color_slider_labeled(label_text, clr):
function ColorSlider(const labelText: String; const clr: Color): Color
Disable Interface
Disables the interface temporarily. Elements created after this function will appear disabled and cannot be interacted with.
Signatures:
void disable_interface()
public static void SplashKit.DisableInterface();
def disable_interface():
procedure DisableInterface()
Draw Interface
Draws the user interface that all the previous calls (such as Start Panel
, Button
, etc) have created. Make sure to call this! Without calling it, the interface won’t be visible.
Signatures:
void draw_interface()
public static void SplashKit.DrawInterface();
def draw_interface():
procedure DrawInterface()
Usage:
Enable Interface
Re-enables the interface, reverses the effects of disabling the interface.
Signatures:
void enable_interface()
public static void SplashKit.EnableInterface();
def enable_interface():
procedure EnableInterface()
End Inset
Finishes the creation of an inset area.
Parameters:
Name | Type | Description |
---|---|---|
name | String | The area’s name - must match with Start Inset |
Signatures:
void end_inset(const string &name)
public static void SplashKit.EndInset(string name);
def end_inset(name):
procedure EndInset(const name: String)
End Panel
Finishes the creation of a panel.
Parameters:
Name | Type | Description |
---|---|---|
name | String | The name shown in the panel’s titlebar - must match with Start Panel |
Signatures:
void end_panel(const string &name)
public static void SplashKit.EndPanel(string name);
def end_panel(name):
procedure EndPanel(const name: String)
End Popup
Finishes the creation of a popup.
Parameters:
Name | Type | Description |
---|---|---|
name | String | The popup’s name - must match with Start Popup |
Signatures:
void end_popup(const string &name)
public static void SplashKit.EndPopup(string name);
def end_popup(name):
procedure EndPopup(const name: String)
End Treenode
Finishes the creation of a tree node.
Parameters:
Name | Type | Description |
---|---|---|
label_text | String | The node’s name - must match with Start Treenode |
Signatures:
void end_treenode(const string &label_text)
public static void SplashKit.EndTreenode(string labelText);
def end_treenode(label_text):
procedure EndTreenode(const labelText: String)
Enter Column
Begins placing elements inside the current column. Must be paired with a call to Leave Column
.
Signatures:
void enter_column()
public static void SplashKit.EnterColumn();
def enter_column():
procedure EnterColumn()
Get Interface Label Width
Returns the width of element labels. Default is 60 pixels.
Return Type: Integer
Signatures:
int get_interface_label_width()
public static int SplashKit.GetInterfaceLabelWidth();
def get_interface_label_width():
function GetInterfaceLabelWidth(): Integer
Header
Creates a collapsable header with a label. Returns whether the header is expanded or not. Note: Unlike Start Panel
and other similar functions, there is no need to ‘end’ this one. Example usage: c++ if (header("Section A")) { // elements inside header go here }
Parameters:
Name | Type | Description |
---|---|---|
label_text | String | The label to show in the header |
Return Type: Boolean
Signatures:
bool header(const string &label_text)
public static bool SplashKit.Header(string labelText);
def header(label_text):
function Header(const labelText: String): Boolean
Hsb Color Slider
Hsb Color Slider
Creates a set of HSBA (hue, saturation, brightness, alpha) sliders to adjust a color, at a specific position on screen. Returns the updated color value of the slider.
Parameters:
Name | Type | Description |
---|---|---|
clr | Color | The current value of the color slider |
rect | Rectangle | The rectangle to display the slider in. |
Return Type: Color
Signatures:
color hsb_color_slider(const color &clr, const rectangle &rect)
public static Color SplashKit.HSBColorSlider(Color clr, Rectangle rect);
def hsb_color_slider_at_position(clr, rect):
function HSBColorSlider(const clr: Color; const rect: Rectangle): Color
Hsb Color Slider
Creates a set of HSBA (hue, saturation, brightness, alpha) sliders to adjust a color. Returns the updated color value of the slider.
Parameters:
Name | Type | Description |
---|---|---|
clr | Color | The current value of the color slider |
Return Type: Color
Signatures:
color hsb_color_slider(const color &clr)
public static Color SplashKit.HSBColorSlider(Color clr);
def hsb_color_slider(clr):
function HSBColorSlider(const clr: Color): Color
Hsb Color Slider
Creates a set of HSBA (hue, saturation, brightness, alpha) sliders to adjust a color, with a label. Returns the updated color value of the slider. Example usage: c++ my_color = hsb_color_slider("Player Color", my_color);
Parameters:
Name | Type | Description |
---|---|---|
label_text | String | The label to show in front of the slider |
clr | Color | The current value of the color slider |
Return Type: Color
Signatures:
color hsb_color_slider(const string &label_text, const color &clr)
public static Color SplashKit.HSBColorSlider(string labelText, Color clr);
def hsb_color_slider_labeled(label_text, clr):
function HSBColorSlider(const labelText: String; const clr: Color): Color
Interface Enabled
Returns if the interface is currently enabled or not.
Return Type: Boolean
Signatures:
bool interface_enabled()
public static bool SplashKit.InterfaceEnabled();
def interface_enabled():
function InterfaceEnabled(): Boolean
Interface Style Panel
A utility function to show a ‘Style Panel’, which will allows you to experiment with different interface styles.
Parameters:
Name | Type | Description |
---|---|---|
initial_rectangle | Rectangle | The initial position/size the panel starts off in |
Signatures:
void interface_style_panel(const rectangle &initial_rectangle)
public static void SplashKit.InterfaceStylePanel(Rectangle initialRectangle);
def interface_style_panel(initial_rectangle):
procedure InterfaceStylePanel(const initialRectangle: Rectangle)
Label Element
Label Element
Creates a label with the given text.
Parameters:
Name | Type | Description |
---|---|---|
text | String | The label to show |
Signatures:
void label_element(const string &text)
public static void SplashKit.LabelElement(string text);
def label_element(text):
procedure LabelElement(const text: String)
Label Element
Creates a label at a specific position on screen.
Parameters:
Name | Type | Description |
---|---|---|
text | String | The label to show |
rect | Rectangle | The rectangle to display the label in |
Signatures:
void label_element(const string &text, const rectangle &rect)
public static void SplashKit.LabelElement(string text, Rectangle rect);
def label_element_at_position(text, rect):
procedure LabelElement(const text: String; const rect: Rectangle)
Last Element Changed
Returns if the last created element was changed at all (such as dragged, typed in, etc)
Return Type: Boolean
Signatures:
bool last_element_changed()
public static bool SplashKit.LastElementChanged();
def last_element_changed():
function LastElementChanged(): Boolean
Last Element Confirmed
Returns if the last created element was ‘confirmed’ (such as clicking a button, or hitting enter in a text box)
Return Type: Boolean
Signatures:
bool last_element_confirmed()
public static bool SplashKit.LastElementConfirmed();
def last_element_confirmed():
function LastElementConfirmed(): Boolean
Leave Column
Stops placing elements inside the current column and moves to the next one.
Signatures:
void leave_column()
public static void SplashKit.LeaveColumn();
def leave_column():
procedure LeaveColumn()
Number Box
Number Box
Creates a number entry box at a specific position on screen. Returns the updated value of the number box.
Parameters:
Name | Type | Description |
---|---|---|
value | Float | The current value of the number box |
step | Float | The amount incremented when dragging on the box |
rect | Rectangle | The rectangle to display the slider in |
Return Type: Float
Signatures:
float number_box(const float &value, float step, const rectangle &rect)
public static float SplashKit.NumberBox(float value, float step, Rectangle rect);
def number_box_at_position(value, step, rect):
function NumberBox(const value: Single; step: Single; const rect: Rectangle): Single
Number Box
Creates a number entry box with a label. Returns the updated value of the number box.
Parameters:
Name | Type | Description |
---|---|---|
value | Float | The current value of the number box |
step | Float | The amount incremented when dragging on the box |
Return Type: Float
Signatures:
float number_box(const float &value, float step)
public static float SplashKit.NumberBox(float value, float step);
def number_box(value, step):
function NumberBox(const value: Single; step: Single): Single
Number Box
Creates a number entry box with a label. Returns the updated value of the number box. Example usage: c++ my_float = number_box("Percentage", my_float, 1);
Parameters:
Name | Type | Description |
---|---|---|
label_text | String | The label to show in front of the number box |
value | Float | The current value of the number box |
step | Float | The amount incremented when dragging on the box |
Return Type: Float
Signatures:
float number_box(const string &label_text, const float &value, float step)
public static float SplashKit.NumberBox(string labelText, float value, float step);
def number_box_labeled(label_text, value, step):
function NumberBox(const labelText: String; const value: Single; step: Single): Single
Open Popup
Makes the popup named name
open/popup at the cursor’s position.
Parameters:
Name | Type | Description |
---|---|---|
name | String | The popup’s name. Must match with the same name used in Start Popup |
Signatures:
void open_popup(const string &name)
public static void SplashKit.OpenPopup(string name);
def open_popup(name):
procedure OpenPopup(const name: String)
Paragraph
Paragraph
Creates a paragraph of text that auto-wraps.
Parameters:
Name | Type | Description |
---|---|---|
text | String | The text to show |
Signatures:
void paragraph(const string &text)
public static void SplashKit.Paragraph(string text);
def paragraph(text):
procedure Paragraph(const text: String)
Paragraph
Creates a paragraph of text that auto-wraps at a specific position on screen.
Parameters:
Name | Type | Description |
---|---|---|
text | String | The text to show |
rect | Rectangle | The rectangle to display the label in |
Signatures:
void paragraph(const string &text, const rectangle &rect)
public static void SplashKit.Paragraph(string text, Rectangle rect);
def paragraph_at_position(text, rect):
procedure Paragraph(const text: String; const rect: Rectangle)
Reset Layout
Resets to the default layout of a single column with default height.
Signatures:
void reset_layout()
public static void SplashKit.ResetLayout();
def reset_layout():
procedure ResetLayout()
Set Interface Accent Color
Sets the color of accents in the interface, and the contrast of how strongly they appear when hovering/interacting.
Parameters:
Name | Type | Description |
---|---|---|
clr | Color | The color of accents |
contrast | Float | The strength of how much the accents show (between 0 and 1) |
Signatures:
void set_interface_accent_color(color clr, float contrast)
public static void SplashKit.SetInterfaceAccentColor(Color clr, float contrast);
def set_interface_accent_color(clr, contrast):
procedure SetInterfaceAccentColor(clr: Color; contrast: Single)
Set Interface Border Color
Sets the interface’s border color.
Parameters:
Name | Type | Description |
---|---|---|
clr | Color | The color to set borders to |
Signatures:
void set_interface_border_color(color clr)
public static void SplashKit.SetInterfaceBorderColor(Color clr);
def set_interface_border_color(clr):
procedure SetInterfaceBorderColor(clr: Color)
Set Interface Colors Auto
A convenience function to set the majority of the interface’s colors in one go. Some colors will be automatically chosen based on the parameters (such as text color).
Parameters:
Name | Type | Description |
---|---|---|
main_clr | Color | The main color of the interface - also decides if the interface is light or dark mode |
accent_clr | Color | The color used to accent the interface - this will appear in highlighted areas |
contrast | Float | The contrast between the frames of elements/containers and their internal elements |
accent_contrast | Float | How strongly the accent color is used, for instance when highlighting elements |
border_contrast | Float | Simply the opacity of the borders |
Signatures:
void set_interface_colors_auto(color main_clr, color accent_clr, float contrast, float accent_contrast, float border_contrast)
public static void SplashKit.SetInterfaceColorsAuto(Color mainClr, Color accentClr, float contrast, float accentContrast, float borderContrast);
def set_interface_colors_auto(main_clr, accent_clr, contrast, accent_contrast, border_contrast):
procedure SetInterfaceColorsAuto(mainClr: Color; accentClr: Color; contrast: Single; accentContrast: Single; borderContrast: Single)
Set Interface Element Color
Sets the main color of elements in the interface, and the contrast between their frame and internal pieces.
Parameters:
Name | Type | Description |
---|---|---|
clr | Color | The color of elements |
contrast | Float | The contrast between the frame of elements and their internal pieces (between 0 and 1) |
Signatures:
void set_interface_element_color(color clr, float contrast)
public static void SplashKit.SetInterfaceElementColor(Color clr, float contrast);
def set_interface_element_color(clr, contrast):
procedure SetInterfaceElementColor(clr: Color; contrast: Single)
Set Interface Element Shadows
Sets the style of element’s shadows. Use a fully transparent color to disable them.
Parameters:
Name | Type | Description |
---|---|---|
radius | Integer | The radius of the shadow’s blur |
clr | Color | The color of the shadows (commonly black, but can do coloured and semi-transparent too) |
offset | Point 2d | The offset in x/y coordinates of the shadows from their casting elements |
Signatures:
void set_interface_element_shadows(int radius, color clr, point_2d offset)
public static void SplashKit.SetInterfaceElementShadows(int radius, Color clr, Point2D offset);
def set_interface_element_shadows(radius, clr, offset):
procedure SetInterfaceElementShadows(radius: Integer; clr: Color; offset: Point2D)
Set Interface Font
Set Interface Font
Sets the interface’s font.
Parameters:
Name | Type | Description |
---|---|---|
fnt | String | The name of the font to be used |
Signatures:
void set_interface_font(const string &fnt)
public static void SplashKit.SetInterfaceFont(string fnt);
def set_interface_font_font_as_string(fnt):
procedure SetInterfaceFont(const fnt: String)
Set Interface Font
Sets the interface’s font.
Parameters:
Name | Type | Description |
---|---|---|
fnt | Font | The font to be used |
Signatures:
void set_interface_font(font fnt)
public static void SplashKit.SetInterfaceFont(Font fnt);
def set_interface_font(fnt):
procedure SetInterfaceFont(fnt: Font)
Set Interface Font Size
Sets the interface’s font size.
Parameters:
Name | Type | Description |
---|---|---|
size | Integer | The font size to be used |
Signatures:
void set_interface_font_size(int size)
public static void SplashKit.SetInterfaceFontSize(int size);
def set_interface_font_size(size):
procedure SetInterfaceFontSize(size: Integer)
Set Interface Label Width
Sets the width of element labels. This is the maximum width in pixels that a label can span in front of an element. Default is 60 pixels.
Parameters:
Name | Type | Description |
---|---|---|
width | Integer | The width of labels |
Signatures:
void set_interface_label_width(int width)
public static void SplashKit.SetInterfaceLabelWidth(int width);
def set_interface_label_width(width):
procedure SetInterfaceLabelWidth(width: Integer)
Set Interface Panel Shadows
Sets the style of panel’s shadows. Use a fully transparent color to disable them.
Parameters:
Name | Type | Description |
---|---|---|
radius | Integer | The radius of the shadow’s blur |
clr | Color | The color of the shadows (commonly black, but can do coloured and semi-transparent too) |
offset | Point 2d | The offset in x/y coordinates of the shadows from their casting elements |
Signatures:
void set_interface_panel_shadows(int radius, color clr, point_2d offset)
public static void SplashKit.SetInterfacePanelShadows(int radius, Color clr, Point2D offset);
def set_interface_panel_shadows(radius, clr, offset):
procedure SetInterfacePanelShadows(radius: Integer; clr: Color; offset: Point2D)
Set Interface Root Text Color
Sets color of text drawn directly onto the main window
Parameters:
Name | Type | Description |
---|---|---|
clr | Color | The color to set text drawn on the main window to |
Signatures:
void set_interface_root_text_color(color clr)
public static void SplashKit.SetInterfaceRootTextColor(Color clr);
def set_interface_root_text_color(clr):
procedure SetInterfaceRootTextColor(clr: Color)
Set Interface Shadows
Sets the style of all interface shadows. Use a fully transparent color to disable them.
Parameters:
Name | Type | Description |
---|---|---|
radius | Integer | The radius of the shadow’s blur |
clr | Color | The color of the shadows (commonly black, but can do coloured and semi-transparent too) |
offset | Point 2d | The offset in x/y coordinates of the shadows from their casting elements |
Signatures:
void set_interface_shadows(int radius, color clr, point_2d offset)
public static void SplashKit.SetInterfaceShadows(int radius, Color clr, Point2D offset);
def set_interface_shadows(radius, clr, offset):
procedure SetInterfaceShadows(radius: Integer; clr: Color; offset: Point2D)
Set Interface Spacing
Sets the spacing within the interface.
Parameters:
Name | Type | Description |
---|---|---|
spacing | Integer | The distance between elements |
padding | Integer | The padding within elements |
Signatures:
void set_interface_spacing(int spacing, int padding)
public static void SplashKit.SetInterfaceSpacing(int spacing, int padding);
def set_interface_spacing(spacing, padding):
procedure SetInterfaceSpacing(spacing: Integer; padding: Integer)
Set Interface Style
Set Interface Style
Sets the interface style to one of the presets in the interface_style enum.
Parameters:
Name | Type | Description |
---|---|---|
style | Interface Style | The preset style to use |
Signatures:
void set_interface_style(interface_style style)
public static void SplashKit.SetInterfaceStyle(InterfaceStyle style);
def set_interface_style(style):
procedure SetInterfaceStyle(style: InterfaceStyle)
Set Interface Style
Sets the interface style to one of the presets in the interface_style enum. Also accepts a color used to customize the interface.
Parameters:
Name | Type | Description |
---|---|---|
style | Interface Style | The preset style to use |
clr | Color | The color to style the interface after |
Signatures:
void set_interface_style(interface_style style, color clr)
public static void SplashKit.SetInterfaceStyle(InterfaceStyle style, Color clr);
def set_interface_style_with_color(style, clr):
procedure SetInterfaceStyle(style: InterfaceStyle; clr: Color)
Set Interface Text Color
Sets the interface’s text color.
Parameters:
Name | Type | Description |
---|---|---|
clr | Color | The color to set text to |
Signatures:
void set_interface_text_color(color clr)
public static void SplashKit.SetInterfaceTextColor(Color clr);
def set_interface_text_color(clr):
procedure SetInterfaceTextColor(clr: Color)
Set Layout Height
Sets the height of each row in the interface in pixels. 0 resets to default.
Parameters:
Name | Type | Description |
---|---|---|
height | Integer | Height of rows in pixels |
Signatures:
void set_layout_height(int height)
public static void SplashKit.SetLayoutHeight(int height);
def set_layout_height(height):
procedure SetLayoutHeight(height: Integer)
Single Line Layout
Starts layouting all elements onto a single row. Reset with reset_layout()
.
Signatures:
void single_line_layout()
public static void SplashKit.SingleLineLayout();
def single_line_layout():
procedure SingleLineLayout()
Slider
Slider
Creates a slider at a specific position on screen. Returns the updated value of the slider.
Parameters:
Name | Type | Description |
---|---|---|
value | Float | The current value of the slider |
min_value | Float | The minimum value of the slider |
max_value | Float | The maximum value of the slider |
rect | Rectangle | The rectangle to display the slider in |
Return Type: Float
Signatures:
float slider(const float &value, float min_value, float max_value, const rectangle &rect)
public static float SplashKit.Slider(float value, float minValue, float maxValue, Rectangle rect);
def slider_at_position(value, min_value, max_value, rect):
function Slider(const value: Single; minValue: Single; maxValue: Single; const rect: Rectangle): Single
Usage:
Slider
Creates a slider without a label. Returns the updated value of the slider.
Parameters:
Name | Type | Description |
---|---|---|
value | Float | The current value of the slider |
min_value | Float | The minimum value of the slider |
max_value | Float | The maximum value of the slider |
Return Type: Float
Signatures:
float slider(const float &value, float min_value, float max_value)
public static float SplashKit.Slider(float value, float minValue, float maxValue);
def slider(value, min_value, max_value):
function Slider(const value: Single; minValue: Single; maxValue: Single): Single
Slider
Creates a slider with a label. Returns the updated value of the slider. Example usage: c++ my_float = slider("Percentage", my_float, 0, 100);
Parameters:
Name | Type | Description |
---|---|---|
label_text | String | The label to show in front of the slider |
value | Float | The current value of the slider |
min_value | Float | The minimum value of the slider |
max_value | Float | The maximum value of the slider |
Return Type: Float
Signatures:
float slider(const string &label_text, const float &value, float min_value, float max_value)
public static float SplashKit.Slider(string labelText, float value, float minValue, float maxValue);
def slider_labeled(label_text, value, min_value, max_value):
function Slider(const labelText: String; const value: Single; minValue: Single; maxValue: Single): Single
Split Into Columns
Split Into Columns
Adds count
columns to the current layout, with equal widths
Parameters:
Name | Type | Description |
---|---|---|
count | Integer | Number of columns to add |
Signatures:
void split_into_columns(int count)
public static void SplashKit.SplitIntoColumns(int count);
def split_into_columns(count):
procedure SplitIntoColumns(count: Integer)
Split Into Columns
Adds count
columns to the current layout, with equal widths. Has extra parameter last_width
, which lets you specify a specific width (in pixels) for the last column.
Parameters:
Name | Type | Description |
---|---|---|
count | Integer | Number of columns to add |
last_width | Integer | The width of the last column in pixels |
Signatures:
void split_into_columns(int count, int last_width)
public static void SplashKit.SplitIntoColumns(int count, int lastWidth);
def split_into_columns_with_last_width(count, last_width):
procedure SplitIntoColumns(count: Integer; lastWidth: Integer)
Split Into Columns Relative
Adds count
columns to the current layout, with equal widths. Has extra parameter last_width
, which lets you specify a specific width (relative to the width of the container, between 0 and 1) for the last column.
Parameters:
Name | Type | Description |
---|---|---|
count | Integer | Number of columns to add |
last_width | Double | The width of the last column as percentage of the container’s width (between 0 and 1) |
Signatures:
void split_into_columns_relative(int count, double last_width)
public static void SplashKit.SplitIntoColumnsRelative(int count, double lastWidth);
def split_into_columns_relative_with_last_width(count, last_width):
procedure SplitIntoColumnsRelative(count: Integer; lastWidth: Double)
Start Custom Layout
Clears the default layout so that a custom layout can be made.
Signatures:
void start_custom_layout()
public static void SplashKit.StartCustomLayout();
def start_custom_layout():
procedure StartCustomLayout()
Start Inset
Start Inset
Starts the creation of an inset area inside an arbitrary rectangle. The function must be accompanied by a call to End Inset
with the same name.
Parameters:
Name | Type | Description |
---|---|---|
name | String | The name of the area |
rect | Rectangle | The rectangle for the inset |
Signatures:
void start_inset(const string &name, const rectangle &rect)
public static void SplashKit.StartInset(string name, Rectangle rect);
def start_inset_at_position(name, rect):
procedure StartInset(const name: String; const rect: Rectangle)
Start Inset
Starts the creation of an inset area inside a panel/popup. Use as follows: c++ start_inset("Inset area", 60); // elements inside area goes here end_inset("Inset area");
The function must be accompanied by a call to End Inset
with the same name.
Parameters:
Name | Type | Description |
---|---|---|
name | String | The name of the area |
height | Integer | Height of the inset area in pixels. -1 fills entire space. Use negative heights to fill up to height away from the bottom |
Signatures:
void start_inset(const string &name, int height)
public static void SplashKit.StartInset(string name, int height);
def start_inset(name, height):
procedure StartInset(const name: String; height: Integer)
Start Panel
Starts the creation of a draggable panel with a title bar. Returns whether the panel is visible or not. Use as follows: c++ if (start_panel("My panel", rectangle_from(0,0,100,100))) { // Rest of interface goes here end_panel("My panel"); }
After calling this, you can then call functions to add elements such as buttons and text boxes inside the panel. The function must be accompanied by a call to End Panel
, that is only called if the panel is visible, and is passed the same name
.
Parameters:
Name | Type | Description |
---|---|---|
name | String | The name shown in the panel’s titlebar |
initial_rectangle | Rectangle | The initial position/size the panel starts off in |
Return Type: Boolean
Signatures:
bool start_panel(const string &name, rectangle initial_rectangle)
public static bool SplashKit.StartPanel(string name, Rectangle initialRectangle);
def start_panel(name, initial_rectangle):
function StartPanel(const name: String; initialRectangle: Rectangle): Boolean
Start Popup
Starts the creation of a popup. Returns whether the popup is visible or not. Usage is the same as Start Panel
, other than the ‘starting rectangle’ will be automatically calculated. The function must be accompanied by a call to End Popup
with the same name.
Parameters:
Name | Type | Description |
---|---|---|
name | String | The name of the popup |
Return Type: Boolean
Signatures:
bool start_popup(const string &name)
public static bool SplashKit.StartPopup(string name);
def start_popup(name):
function StartPopup(const name: String): Boolean
Start Treenode
Starts the creation of a tree node (such as those in a file tree view). Returns whether the tree node is expanded or not. Usage is the same as Start Panel
. The function must be accompanied by a call to End Treenode
with the same name.
Parameters:
Name | Type | Description |
---|---|---|
label_text | String | The name of the node |
Return Type: Boolean
Signatures:
bool start_treenode(const string &label_text)
public static bool SplashKit.StartTreenode(string labelText);
def start_treenode(label_text):
function StartTreenode(const labelText: String): Boolean
Text Box
Text Box
Creates a text entry box with a label. Returns the updated value of the text box.
Parameters:
Name | Type | Description |
---|---|---|
value | String | The current value of the text box |
Return Type: String
Signatures:
string text_box(const string &value)
public static string SplashKit.TextBox(string value);
def text_box(value):
function TextBox(const value: String): String
Text Box
Creates a text entry box at a specific position on screen. Returns the updated value of the text box. Example usage: c++ my_string = text_box("Name", my_string);
Parameters:
Name | Type | Description |
---|---|---|
value | String | The current value of the text box |
rect | Rectangle | The rectangle to display the button in |
Return Type: String
Signatures:
string text_box(const string &value, const rectangle &rect)
public static string SplashKit.TextBox(string value, Rectangle rect);
def text_box_at_position(value, rect):
function TextBox(const value: String; const rect: Rectangle): String
Usage:
Text Box
Creates a text entry box with a label. Returns the updated value of the text box. Example usage: c++ my_string = text_box("Name", my_string);
Parameters:
Name | Type | Description |
---|---|---|
label_text | String | The label to show in front of the text box |
value | String | The current value of the text box |
Return Type: String
Signatures:
string text_box(const string &label_text, const string &value)
public static string SplashKit.TextBox(string labelText, string value);
def text_box_labeled(label_text, value):
function TextBox(const labelText: String; const value: String): String