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 Interface.AddColumn(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 Interface.AddColumnRelative(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 Interface.BitmapButton(Bitmap bmp);public static bool SplashKit.BitmapButton(Bitmap bmp);def bitmap_button(bmp):function BitmapButton(bmp: Bitmap): BooleanBitmap 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 Interface.BitmapButton(Bitmap bmp, 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): BooleanBitmap 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 Interface.BitmapButton(Bitmap bmp, Rectangle rect, DrawingOptions 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): BooleanBitmap 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 Interface.BitmapButton(Bitmap bmp, DrawingOptions opts);public static bool SplashKit.BitmapButton(Bitmap bmp, DrawingOptions opts);def bitmap_button_with_options(bmp, opts):function BitmapButton(bmp: Bitmap; opts: DrawingOptions): BooleanBitmap Button
Creates a button with a bitmap in it and a label. Returns whether the button was clicked.
Parameters:
| Name | Type | Description |
|---|---|---|
| label | 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, bitmap bmp)public static bool Interface.BitmapButton(string label, Bitmap bmp);public static bool SplashKit.BitmapButton(string label, Bitmap bmp);def bitmap_button_labeled(label, bmp):function BitmapButton(const label: String; bmp: Bitmap): BooleanBitmap Button
Creates a button with a bitmap in it and a label. Returns whether the button was clicked.
Parameters:
| Name | Type | Description |
|---|---|---|
| label | 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, bitmap bmp, drawing_options opts)public static bool Interface.BitmapButton(string label, Bitmap bmp, DrawingOptions opts);public static bool SplashKit.BitmapButton(string label, Bitmap bmp, DrawingOptions opts);def bitmap_button_labeled_with_options(label, bmp, opts):function BitmapButton(const label: String; bmp: Bitmap; opts: DrawingOptions): BooleanButton
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 Interface.Button(string text, 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): BooleanButton
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 Interface.Button(string text);public static bool SplashKit.Button(string text);def button(text):function Button(const text: String): BooleanButton
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 | 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, const string &text)public static bool Interface.Button(string label, string text);public static bool SplashKit.Button(string label, string text);def button_labeled(label, text):function Button(const label: String; const text: String): BooleanCheckbox
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 Interface.Checkbox(string text, bool value, 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): BooleanCheckbox
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 Interface.Checkbox(string text, bool value);public static bool SplashKit.Checkbox(string text, bool value);def checkbox(text, value):function Checkbox(const text: String; const value: Boolean): BooleanCheckbox
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 | 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, const string &text, const bool &value)public static bool Interface.Checkbox(string label, string text, bool value);public static bool SplashKit.Checkbox(string label, string text, bool value);def checkbox_labeled(label, text, value):function Checkbox(const label: String; const text: String; const value: Boolean): BooleanColor 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 Interface.ColorSlider(Color clr, 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): ColorColor 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 Interface.ColorSlider(Color clr);public static Color SplashKit.ColorSlider(Color clr);def color_slider(clr):function ColorSlider(const clr: Color): ColorColor 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 | 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, const color &clr)public static Color Interface.ColorSlider(string label, Color clr);public static Color SplashKit.ColorSlider(string label, Color clr);def color_slider_labeled(label, clr):function ColorSlider(const label: String; const clr: Color): ColorDisable 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 Interface.DisableInterface();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 Interface.DrawInterface();public static void SplashKit.DrawInterface();def draw_interface():procedure DrawInterface()Enable Interface
Re-enables the interface, reverses the effects of disabling the interface.
Signatures:
void enable_interface()public static void Interface.EnableInterface();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 Interface.EndInset(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 Interface.EndPanel(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 Interface.EndPopup(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 | String | The node’s name - must match with Start Treenode |
Signatures:
void end_treenode(const string &label)public static void Interface.EndTreenode(string label);public static void SplashKit.EndTreenode(string label);def end_treenode(label):procedure EndTreenode(const label: 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 Interface.EnterColumn();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 Interface.GetInterfaceLabelWidth();public static int SplashKit.GetInterfaceLabelWidth();def get_interface_label_width():function GetInterfaceLabelWidth(): IntegerHeader
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 | String | The label to show in the header |
Return Type: Boolean
Signatures:
bool header(const string &label)public static bool Interface.Header(string label);public static bool SplashKit.Header(string label);def header(label):function Header(const label: String): BooleanHsb 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 Interface.HSBColorSlider(Color clr, 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): ColorHsb 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 Interface.HSBColorSlider(Color clr);public static Color SplashKit.HSBColorSlider(Color clr);def hsb_color_slider(clr):function HSBColorSlider(const clr: Color): ColorHsb 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 | 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, const color &clr)public static Color Interface.HSBColorSlider(string label, Color clr);public static Color SplashKit.HSBColorSlider(string label, Color clr);def hsb_color_slider_labeled(label, clr):function HSBColorSlider(const label: String; const clr: Color): ColorInterface Enabled
Returns if the interface is currently enabled or not.
Return Type: Boolean
Signatures:
bool interface_enabled()public static bool Interface.InterfaceEnabled();public static bool SplashKit.InterfaceEnabled();def interface_enabled():function InterfaceEnabled(): BooleanInterface 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 Interface.InterfaceStylePanel(Rectangle initialRectangle);public static void SplashKit.InterfaceStylePanel(Rectangle initialRectangle);def interface_style_panel(initial_rectangle):procedure InterfaceStylePanel(const initialRectangle: Rectangle)Label
Label
Creates a label.
Parameters:
| Name | Type | Description |
|---|---|---|
| label | String | The label to show |
Signatures:
void label(const string &label)public static void Interface.Label(string label);public static void SplashKit.Label(string label);def label(label):procedure Label(const label: String)Label
Creates a label at a specific position on screen.
Parameters:
| Name | Type | Description |
|---|---|---|
| label | String | The label to show |
| rect | Rectangle | The rectangle to display the label in |
Signatures:
void label(const string &label, const rectangle &rect)public static void Interface.Label(string label, Rectangle rect);public static void SplashKit.Label(string label, Rectangle rect);def label_at_position(label, rect):procedure Label(const label: 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 Interface.LastElementChanged();public static bool SplashKit.LastElementChanged();def last_element_changed():function LastElementChanged(): BooleanLast 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 Interface.LastElementConfirmed();public static bool SplashKit.LastElementConfirmed();def last_element_confirmed():function LastElementConfirmed(): BooleanLeave Column
Stops placing elements inside the current column and moves to the next one.
Signatures:
void leave_column()public static void Interface.LeaveColumn();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 Interface.NumberBox(float value, float step, 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): SingleNumber 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 Interface.NumberBox(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): SingleNumber 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 | 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, const float &value, float step)public static float Interface.NumberBox(string label, float value, float step);public static float SplashKit.NumberBox(string label, float value, float step);def number_box_labeled(label, value, step):function NumberBox(const label: String; const value: Single; step: Single): SingleOpen 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 Interface.OpenPopup(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 Interface.Paragraph(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 Interface.Paragraph(string text, 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 Interface.ResetLayout();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 Interface.SetInterfaceAccentColor(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 Interface.SetInterfaceBorderColor(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 Interface.SetInterfaceColorsAuto(Color mainClr, Color accentClr, float contrast, float accentContrast, float borderContrast);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 Interface.SetInterfaceElementColor(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 Interface.SetInterfaceElementShadows(int radius, Color clr, Point2D 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 Interface.SetInterfaceFont(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 Interface.SetInterfaceFont(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 Interface.SetInterfaceFontSize(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 Interface.SetInterfaceLabelWidth(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 Interface.SetInterfacePanelShadows(int radius, Color clr, Point2D 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 Interface.SetInterfaceRootTextColor(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 Interface.SetInterfaceShadows(int radius, Color clr, Point2D 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 Interface.SetInterfaceSpacing(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 Interface.SetInterfaceStyle(InterfaceStyle 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 Interface.SetInterfaceStyle(InterfaceStyle 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 Interface.SetInterfaceTextColor(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 Interface.SetLayoutHeight(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 Interface.SingleLineLayout();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 Interface.Slider(float value, float minValue, float maxValue, 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): SingleSlider
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 Interface.Slider(float value, float minValue, float maxValue);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): SingleSlider
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 | 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, const float &value, float min_value, float max_value)public static float Interface.Slider(string label, float value, float minValue, float maxValue);public static float SplashKit.Slider(string label, float value, float minValue, float maxValue);def slider_labeled(label, value, min_value, max_value):function Slider(const label: String; const value: Single; minValue: Single; maxValue: Single): SingleSplit 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 Interface.SplitIntoColumns(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 Interface.SplitIntoColumns(int count, int lastWidth);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 Interface.SplitIntoColumnsRelative(int count, double lastWidth);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 Interface.StartCustomLayout();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 Interface.StartInset(string name, 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 Interface.StartInset(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 Interface.StartPanel(string name, Rectangle initialRectangle);public static bool SplashKit.StartPanel(string name, Rectangle initialRectangle);def start_panel(name, initial_rectangle):function StartPanel(const name: String; initialRectangle: Rectangle): BooleanStart 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 Interface.StartPopup(string name);public static bool SplashKit.StartPopup(string name);def start_popup(name):function StartPopup(const name: String): BooleanStart 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 | String | The name of the node |
Return Type: Boolean
Signatures:
bool start_treenode(const string &label)public static bool Interface.StartTreenode(string label);public static bool SplashKit.StartTreenode(string label);def start_treenode(label):function StartTreenode(const label: String): BooleanText 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 Interface.TextBox(string value);public static string SplashKit.TextBox(string value);def text_box(value):function TextBox(const value: String): StringText 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 Interface.TextBox(string value, 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): StringText 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 | 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, const string &value)public static string Interface.TextBox(string label, string value);public static string SplashKit.TextBox(string label, string value);def text_box_labeled(label, value):function TextBox(const label: String; const value: String): String