Style¶
- structure Style¶
This object represents the style of a widget. Styles can be either changed directly on a
Widget
, or changed on the GUI:SKIN so as to affect all subsequently created widgets of a particular type inside that GUI.Suffix
Type
Description
Should the widget stretch horizontally? (default depends on widget subclass)
Should the widget stretch vertically?
Scalar
(pixels)Fixed width (or 0 if flexible).
Scalar
(pixels)Fixed height (or 0 if flexible).
Spacing between this and other widgets.
Spacing between the outside of the widget and its contents (text, etc.).
Size of the edges in the 9-slice image for BG images in NORMAL, HOVER, etc.
Extra space added to the area of the background image. Allows the background to go beyond the widget’s rectangle.
One of “CENTER”, “LEFT”, or “RIGHT”. See note below.
The name of the font of the text on the content or “” if the default.
The size of the text on the content.
Set to False to disable rich-text (<i>…</i>, etc.)
Properties for the widget normally.
Properties for when the widget is under the mouse and “on”.
Alias for ON.
Properties for when the widget is under the mouse.
Properties for when the widget is under the mouse and “on”.
Properties for when the widget is active (eg. button being held down).
Properties for when the widget is active and “on”.
Properties for when the widget has keyboard focus.
Properties for when the widget has keyboard focus and is “on”.
The same as NORMAL:BG. Name of a “9-slice” image file.
The same as NORMAL:TEXTCOLOR. The color of the text on the label.
Can labels be broken into multiple lines on word boundaries?
- Style:HSTRETCH¶
- Type
- Access
Get/Set
Should the widget stretch horizontally? (default depends on widget subclass)
- Style:MARGIN¶
- Type
- Access
Get/Set
Spacing between this and other widgets.
- Style:PADDING¶
- Type
- Access
Get/Set
Spacing between the outside of the widget and its contents (text, etc.).
- Style:BORDER¶
- Type
- Access
Get/Set
Size of the edges in the 9-slice image for BG images in NORMAL, HOVER, etc.
- Style:OVERFLOW¶
- Type
- Access
Get/Set
Extra space added to the area of the background image. Allows the background to go beyond the widget’s rectangle.
Note
The ALIGN attribute will not do anything useful unless either HSTRETCH is set to true or a fixed WIDTH is set, since otherwise it will be exactly the right size to fit the content of the widget with no alignment within that space being necessary.
It is currently only relevant for the widgets that have scalar content (Label and subclasses).
- Style:FONT¶
- Type
- Access
Get/Set
The name of the font of the text on the content or “” if the default. 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
- Style:NORMAL¶
- Type
- Access
Get/Set
Properties for the widget normally.
- Style:ON¶
- Type
- Access
Get/Set
Properties for when the widget is under the mouse and “on”.
- Style:NORMAL_ON¶
- Type
- Access
Get/Set
Alias for ON.
- Style:HOVER¶
- Type
- Access
Get/Set
Properties for when the widget is under the mouse.
- Style:HOVER_ON¶
- Type
- Access
Get/Set
Properties for when the widget is under the mouse and “on”.
- Style:ACTIVE¶
- Type
- Access
Get/Set
Properties for when the widget is active (eg. button being held down).
- Style:ACTIVE_ON¶
- Type
- Access
Get/Set
Properties for when the widget is active and “on”.
- Style:FOCUSED¶
- Type
- Access
Get/Set
Properties for when the widget has keyboard focus.
- Style:FOCUSED_ON¶
- Type
- Access
Get/Set
Properties for when the widget has keyboard focus and is “on”.
- Style:TEXTCOLOR¶
- Type
color
The same as NORMAL:TEXTCOLOR. The color of the text on the label.