Skin

structure Skin

A Skin is a set of Style settings defined for various widget types. It defines what default style will be used for each type of widget inside the GUI. Changes to the styles on a GUI:SKIN will affect the subsequently created widgets inside that GUI window. Note that some of the styles are used by subparts of widgets, such as the HORIZONTALSLIDERTHUMB, which is used by a SLIDER when oriented horizontally.

If you create your own composite widgets, you can use ADD and GET to centralize setting up the style of your composite widgets.

If you wish to make a complete new Skin, the cleanest method would be to put all the graphics in a directory, along with a kOS script that given a GUI:SKIN, changes everything in that skin as needed, allowing users to run your script with their GUI:SKIN to make it use your custom skin.

Suffix Type Description
BOX Style Style for Box widgets.
BUTTON Style Style for Button widgets.
HORIZONTALSCROLLBAR Style Style for the horizontal scrollbar of ScrollBox widgets.
HORIZONTALSCROLLBARLEFTBUTTON Style Style for the horizontal scrollbar left button of ScrollBox widgets.
HORIZONTALSCROLLBARRIGHTBUTTON Style Style for the horizontal scrollbar right button of ScrollBox widgets.
HORIZONTALSCROLLBARTHUMB Style Style for the horizontal scrollbar thumb of ScrollBox widgets.
HORIZONTALSLIDER Style Style for horizontal Slider widgets.
HORIZONTALSLIDERTHUMB Style Style for the thumb of horizontal Slider widgets.
VERTICALSCROLLBAR Style Style for the vertical scrollbar of ScrollBox widgets.
VERTICALSCROLLBARLEFTBUTTON Style Style for the vertical scrollbar left button of ScrollBox widgets.
VERTICALSCROLLBARRIGHTBUTTON Style Style for the vertical scrollbar right button of ScrollBox widgets.
VERTICALSCROLLBARTHUMB Style Style for the vertical scrollbar thumb of ScrollBox widgets.
VERTICALSLIDER Style Style for vertical Slider widgets.
VERTICALSLIDERTHUMB Style Style for the thumb of vertical Slider widgets.
LABEL Style Style for Label widgets.
SCROLLVIEW Style Style for ScrollBox widgets.
TEXTFIELD Style Style for TextField widgets.
TOGGLE Style Style for Button widgets in toggle mode (GUI:ADDCHECKBOX and GUI:ADDRADIOBUTTON).
FLATLAYOUT Style Style for Box transparent widgets (GUI:ADDHLAYOUT and GUI:ADDVLAYOUT).
POPUPMENU Style Style for PopupMenu widgets.
POPUPWINDOW Style Style for the popup window of PopupMenu widgets.
POPUPMENUITEM Style Style for the menu items of PopupMenu widgets.
LABELTIPOVERLAY Style Style for tooltips overlayed on Label widgets.
WINDOW Style Style for GUI windows.
FONT string The name of the font used (if STYLE:FONT does not change it for an element).
SELECTIONCOLOR Color The background color of selected text (eg. TEXTFIELD).
ADD(name, style) Style Adds a new style.
HAS(name) Boolean Does the skin have the named style?
GET(name) Style Gets a style by name (including ADDed styles).
Skin:BOX
Type:Style
Access:Get/Set

Style for Box widgets.

Skin:BUTTON
Type:Style
Access:Get/Set

Style for Button widgets.

Skin:HORIZONTALSCROLLBAR
Type:Style
Access:Get/Set

Style for the horizontal scrollbar of ScrollBox widgets.

Skin:HORIZONTALSCROLLBARLEFTBUTTON
Type:Style
Access:Get/Set

Style for the horizontal scrollbar left button of ScrollBox widgets.

Skin:HORIZONTALSCROLLBARRIGHTBUTTON
Type:Style
Access:Get/Set

Style for the horizontal scrollbar right button of ScrollBox widgets.

Skin:HORIZONTALSCROLLBARTHUMB
Type:Style
Access:Get/Set

Style for the horizontal scrollbar thumb of ScrollBox widgets.

Skin:HORIZONTALSLIDER
Type:Style
Access:Get/Set

Style for horizontal Slider widgets.

Skin:HORIZONTALSLIDERTHUMB
Type:Style
Access:Get/Set

Style for the thumb of horizontal Slider widgets.

Skin:VERTICALSCROLLBAR
Type:Style
Access:Get/Set

Style for the vertical scrollbar of ScrollBox widgets.

Skin:VERTICALSCROLLBARLEFTBUTTON
Type:Style
Access:Get/Set

Style for the vertical scrollbar left button of ScrollBox widgets.

Skin:VERTICALSCROLLBARRIGHTBUTTON
Type:Style
Access:Get/Set

Style for the vertical scrollbar right button of ScrollBox widgets.

Skin:VERTICALSCROLLBARTHUMB
Type:Style
Access:Get/Set

Style for the vertical scrollbar thumb of ScrollBox widgets.

Skin:VERTICALSLIDER
Type:Style
Access:Get/Set

Style for vertical Slider widgets.

Skin:VERTICALSLIDERTHUMB
Type:Style
Access:Get/Set

Style for the thumb of vertical Slider widgets.

Skin:LABEL
Type:Style
Access:Get/Set

Style for Label widgets.

Skin:SCROLLVIEW
Type:Style
Access:Get/Set

Style for ScrollBox widgets.

Skin:TEXTFIELD
Type:Style
Access:Get/Set

Style for TextField widgets.

Skin:TOGGLE
Type:Style
Access:Get/Set

Style for Button widgets in toggle mode (GUI:ADDCHECKBOX and GUI:ADDRADIOBUTTON).

Skin:FLATLAYOUT
Type:Style
Access:Get/Set

Style for Box transparent widgets (GUI:ADDHLAYOUT and GUI:ADDVLAYOUT).

Skin:POPUPMENU
Type:Style
Access:Get/Set

Style for PopupMenu widgets.

Skin:POPUPWINDOW
Type:Style
Access:Get/Set

Style for the popup window of PopupMenu widgets.

Skin:POPUPMENUITEM
Type:Style
Access:Get/Set

Style for the menu items of PopupMenu widgets.

Skin:LABELTIPOVERLAY
Type:Style
Access:Get/Set

Style for tooltips overlayed on Label widgets.

Skin:WINDOW
Type:Style
Access:Get/Set

Style for GUI windows.

Skin:FONT
Type:string
Access:Get/Set

The name of the font used (if STYLE:FONT does not change it for an element). If you want to see the list of available font names, you can do so with List Fonts.. Please note that just because you see a font in that list on your computer, that doesn’t always mean that same font will exist on someone else’s computer. KSP ships with a few fonts that it does universally put on all platform installs, but other fonts in that list might be installed locally on your computer only by other mods (like kOS itself, which loads all your monospaced fonts for optional use as the terminal font). Fonts that we know KSP itself tends to install are: Arial, CALIBRI, HEADINGFONT, calibri, calibrib, calibriz, calibril, and dotty

Skin:SELECTIONCOLOR
Type:Color
Access:Get/Set

The background color of selected text (eg. TEXTFIELD).

Skin:ADD(name, style)
Parameters:
  • nameString
  • styleStyle - a style to clone here.
Returns:

Style - the copy of the style that was made.

Adds a new style to the skin and names it. The skin holds a list of styles by name which you can retrieve later. Note, this makes a copy of the style you pass in, so changes you make to this new style afterward shouldn’t affect the one you passed in, and visa versa.

Skin:HAS(name)
Parameters:
Returns:

Style

Does the skin have the named style?

Skin:GET(name)
Parameters:
Returns:

Style

Gets a style by name (including ADDed styles).