-
Notifications
You must be signed in to change notification settings - Fork 0
Home
/!\ under progress
This set of controls is used by the K2D2 Kerbal Space Program 2 mod
You can use this repo as an example of use of the controls. https://github.com/cfloutier/test_k2ui
Creates a new Visual Tree Asset
all controls are available in the UI Builder :

all uss files are located in the K2UI/Runtime/Controls/USS folder
use The main K2UI.uss as it includes all others uss files
- Labels
- Groups
- Enumerates
- Toggles
- Sliders
- Compass
- ProgressBar
- Tabs
- Graph lines
please use the KerbalUI Theme
And include the K2UI.uss file in your xml definition.
This uss defines global variables and includes all others uss that is used by all controls.
Complex controls could have it's own uss file ex : K2Toggle.uss or K2Compas.uss
to edit those file I adds them to the UIBuilder. But only the main K2UI.uss is needed for your own UI file.
Ktool are a set of classes used by the Controls
- Settings : a set of class used to bind values with controls and save it to local disc as player preferences.
-
ColorTools : A set of tools for colors
- Convert colors from and to htlml codes. with
parseColorandformatColorHtml - Create gradients and color colections with
getRandomColorArrayandgetRainbowColorArray - use Hue Saturation Value space to and adjust colors with
FromHSV,ToHSVandchangeColorHSV
- Convert colors from and to htlml codes. with
- Extensions : A set of Function that extends standard cs primitives
- ReflexionTool : tools to call reflexion. It is used to call private and protected functions and to access properties. Useful to call 'forbidden' interanl fucntion from the main game (Ksp2 main engine)
- StrTools a set of tools used to convert to string different kind to values : like Duration, Distances and Vectors