Skip to content
cfloutier edited this page Apr 15, 2024 · 16 revisions

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


UI Builder

Creates a new Visual Tree Asset

all controls are available in the UI Builder :

image

.uss

all uss files are located in the K2UI/Runtime/Controls/USS folder use The main K2UI.uss as it includes all others uss files

Controls

Labels (Labels.cs)

Console : a Label used as a console.

class : .console

The control adds a simples Set and Add functions that clear the content and add a new line.

image

StatusLine : label that can change it's color using an Enumerate

usefull control used as the K2D2 pilot current status.

class : .k2-status-line and .k2-status-line--normal / .k2-status-line--warning / .k2-status-line--error

a simple label with a variable used to setup a status color

image image

update the line with

void Set(string text, Level level)

Clone this wiki locally