Offset

data class Offset(var xUnits: OffsetMode, var x: Double, var yUnits: OffsetMode, var y: Double)

Specifies an offset relative to a rectangle. Used by renderable shapes.

Constructors

Link copied to clipboard
constructor(xUnits: OffsetMode, x: Double, yUnits: OffsetMode, y: Double)
constructor(offset: Offset)

Creates a new offset of this offset with identical property values.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
var x: Double

The offset in the X dimension, interpreted according to this instance's xUnits argument.

Link copied to clipboard

The units of this instance's X offset. See this class' constructor description for a list of the possible values.

Link copied to clipboard
var y: Double

The offset in the Y dimension, interpreted according to this instance's yUnits argument.

Link copied to clipboard

The units of this instance's Y offset. See this class' constructor description for a list of the possible values.

Functions

Link copied to clipboard
fun copy(offset: Offset): Offset

Sets this offset to identical property values of the specified offset.

Link copied to clipboard
fun offsetForSize(width: Double, height: Double, result: Vec2): Vec2

Returns this offset's absolute X and Y coordinates in pixels for a rectangle of a specified size in pixels. The returned offset is in pixels relative to the rectangle's origin, and is defined in the coordinate system used by the caller.

Link copied to clipboard
fun set(xUnits: OffsetMode, x: Double, yUnits: OffsetMode, y: Double): Offset

Sets this offset to specified property values.