Skip to main content

XYPadStyle

Options to customize the appearance of the XYPad.

class XYPadStyle

Properties

width

width: Float? = nil

The width of the control. If set to [nil] the image size will be used.


height

height: Float? = nil

The height of the control. If set to [nil] the image size will be used.


background_image

background_image: ImageAsset = default_xy_background_image

An image for the pad/background.


handle_size

handle_size: Float? = nil

The size of the handle (expected to have the same width/height). If set to [nil] the handle_image size will be used.


handle_image

handle_image: ImageAsset = default_xy_handle_image

An image for the handle.


inner_padding

inner_padding: EdgeInsets = EdgeInsets(3)

Shrinks the interactive area to account for a border in the background_image.


label_style

label_style: LabelStyle = default_xy_pad_label_style

Customizates the label appearance.


disabled_opacity

disabled_opacity: Float = 0.24

The opacity to use when the control is disabled.

Methods

copy

copy() -> (XYPadStyle)

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


deep_copy

deep_copy() -> (XYPadStyle)

Returns a deep copy (includes copies of inner_padding and label_style).


overriding

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

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

var modified = (XYPadStyle()).overriding(fun (style) {
style.background_image = ImageAsset(path: "my_xy.png", width: 100, height: 100)
})