Skip to main content

XYPad

Control the active cursor of a KSP ui_xy.

component XYPad

Example

import { XYPad } from kontakt_controls

export var main = XYPad(
control_id: "my_xy",
label: "XY Pad",
)

XYPad Screenshot

Constructor

constructor(control_id: String, label: String, step_count_x: Int? = nil, fine_step_count_x: Int = 2, sensitivity_x: Float = 1, step_count_y: Int? = nil, fine_step_count_y: Int = 2, sensitivity_y: Float = 1, value_to_string: XYValueFormatter = default_xy_value_formatter, style: XYPadStyle = default_xy_pad_style, disabled: Bool = false)
control_id: String

This is the name that you assigned to the corresponding KSP ui_xy control.

label: String

The label to be displayed.

step_count_x: Int? = nil

Determines the number of steps it takes from min to max.

Setting it to nil uses the finest resolution possible.

fine_step_count_x: Int = 2

Further subdivides the steps when "shift" is pressed. Setting it to 1 means disables fine tuning.

If step_count_x is nil, this will reduce the sensitivity.

sensitivity_x: Float = 1

Controls the sensitivity on the x-axis. When set to 1 one can move over the entire value range by moving from the left edge to the right edge.

step_count_y: Int? = nil

Determines the number of steps it takes from min to max.

Setting it to nil uses the finest resolution possible.

fine_step_count_y: Int = 2

Further subdivides the steps when "shift" is pressed. Setting it to 1 means disables fine tuning.

If step_count_y is nil, this will reduce the sensitivity.

sensitivity_y: Float = 1

Controls the sensitivity on the y-axis. When set to 1 one can move over the entire value range by moving from the left edge to the right edge.

value_to_string: XYValueFormatter = default_xy_value_formatter

Converts the x and y value to a string displayed in the label when the user interacts with the control.

By default it simply shows the raw KSP values rounded to two digits.

style: XYPadStyle = XYPadStyle()

Customizes the appearance.

See XYPadStyle

disabled: Bool = false

Disables the interaction with the control.