Skip to main content

ImageAsset

An image asset with metadata important for displaying it in a control.

import { ImageAsset } from kontakt_controls

var my_image = ImageAsset(
path: "rounded_button.png",
width: 128,
height: 24,
frame_count: 8,
fixed_left: 4,
fixed_right: 4,
fixed_top: 4,
fixed_bottom: 4,
)

Properties

path: String

The project relative path.

width: Float

Logical width in pixels.

height: Float

Logical height in pixels.

frame_count: Int = 1

Number of frames if this is a sprite otherwise leave this at 1.

fixed_left: Int = 0

The logical width of the fixed left border for a nine-patch image.

fixed_right: Int = 0

The logical width of the fixed right border for a nine-patch image.

fixed_top: Int = 0

The logical height of the fixed top border for a nine-patch image.

fixed_bottom: Int = 0

The logical height of the fixed bottom border for a nine-patch image.

The logical height of the fixed bottom border for a nine-patch image.