Skip to main content

DraggableControlStyle

class DraggableControlStyle

Constructor

constructor(width: Float? = nil, height: Float? = nil, image: ImageAsset = default_knob_image, handle_size: Float = 0.0, padding: EdgeInsets = EdgeInsets(0.0), label_style: LabelStyle = LabelStyle(), axis: Axis = Axis.vertical, disabled_opacity: Float = 0.24)
width: Float? = nil

Controls the width of the slider. When set to nil, defaults to the image's width.

height: Float? = nil

Controls the height of the slider. When set to nil, defaults to the image's height.

image: ImageAsset = default_knob_image

The image to display.

See ImageAsset.

handle_size: Float = 0.0

Handle size in the dragging axis direction.

padding: EdgeInsets = EdgeInsets(0.0)

The padding area to add around the image to increase the interactive area.

See EdgeInsets.

label_style: LabelStyle = LabelStyle()

Customizes the label appearance.

See LabelStyle.

axis: Axis = Axis.vertical

On which axis the control operates.

See Axis.

disabled_opacity: Float = 0.24

The opacity to apply to the control when disabled.

Properties

width

width: Float? { get set }

Controls the width of the slider. When set to nil, defaults to the image's width.


height

height: Float? { get set }

Controls the height of the slider. When set to nil, defaults to the image's height.


image

image: ImageAsset { get set }

The image to display.

See ImageAsset.


handle_size

handle_size: Float { get set }

Handle size in the dragging axis direction.


padding

padding: EdgeInsets { get set }

The padding area to add around the image to increase the interactive area.

See EdgeInsets.


label_style

label_style: LabelStyle { get set }

Customizes the label appearance.

See LabelStyle.


axis

axis: Axis { get set }

On which axis the control operates.

See Axis.


disabled_opacity

disabled_opacity: Float { get set }

The opacity to apply to the control when disabled.

Methods

copy

copy() -> (DraggableControlStyle)

Returns a shallow copy (nested reference objects aren't copied).


deep_copy

deep_copy() -> (DraggableControlStyle)

Returns a deep copy (includes copying nested reference objects).


overriding

overriding(_ modify: (DraggableControlStyle) -> ()) -> (DraggableControlStyle)

Returns a modified copy of the style. Modify the copy inside the modify function.

Returns a modified copy of the style. Modify the copy inside the modify funtion.

import { DraggableControlStyle, Axis } from kontakt_controls

var modified = (DraggableControlStyle()).overriding(fun (style) {
style.axis = Axis.horizontal
})