Skip to main content

KSPButton

The KSPButton class allows you to connect to a ui_button in KSP.

class KSPButton

Example​

import { KSPButton } from kontakt

var button = KSPButton(id: "my_button")

Constructor​

constructor(id: String)

Connects to a ui_button in KSP with the given control ID.

Properties​

checked​

checked: Bool { get set }

Whether the button is checked.


connected​

connected: Bool { get }

Whether the control is connected. A control might not be connected if no corresponding control was found for the given id.


custom_id​

custom_id: Int { get }

The value of $CONTROL_PAR_CUSTOM_ID set on this control.


id​

id: String { get }

The KSP control ID this button is connected to.


text (8.4)​

text: String { get }

The value of $CONTROL_PAR_TEXT set on this control.

Methods​

toggle​

toggle() -> ()

Toggles the checked state of the button.