SpatialAlignment

interface SpatialAlignment

Known direct subclasses
SpatialBiasAbsoluteAlignment

Positions content in 3D space using horizontal, vertical, and depth bias.

SpatialBiasAlignment

Positions content in 3D space using horizontal, vertical, and depth bias.


An interface to calculate the position of a sized box inside an available 3D space. SpatialAlignment is often used to define the alignment of a layout inside a parent layout.

Summary

Nested types

An interface to calculate the alignment of a box of a certain size inside an available depth.

An interface to calculate the alignment of a box of a certain size inside an available width.

An interface to calculate the alignment of a box of a certain size inside an available height.

Public functions

Vector3
align(
    size: IntVolumeSize,
    space: IntVolumeSize,
    layoutDirection: LayoutDirection
)

Provides the origin-based position of the content in the available space.

Public companion properties

BottomCenter

Added in 1.0.0-beta01
val BottomCenter: SpatialAlignment

BottomEnd

Added in 1.0.0-beta01
val BottomEnd: SpatialAlignment

BottomStart

Added in 1.0.0-beta01
val BottomStart: SpatialAlignment

Center

Added in 1.0.0-beta01
val Center: SpatialAlignment

CenterDepthwise

Added in 1.0.0-beta01
val CenterDepthwise: SpatialAlignment.Depth

CenterEnd

Added in 1.0.0-beta01
val CenterEnd: SpatialAlignment

CenterHorizontally

Added in 1.0.0-beta01
val CenterHorizontally: SpatialAlignment.Horizontal

CenterStart

Added in 1.0.0-beta01
val CenterStart: SpatialAlignment

CenterVertically

Added in 1.0.0-beta01
val CenterVertically: SpatialAlignment.Vertical

Front

Added in 1.0.0-beta01
val Front: SpatialAlignment.Depth

TopCenter

Added in 1.0.0-beta01
val TopCenter: SpatialAlignment

TopEnd

Added in 1.0.0-beta01
val TopEnd: SpatialAlignment

TopStart

Added in 1.0.0-beta01
val TopStart: SpatialAlignment

Public functions

align

Added in 1.0.0-beta01
fun align(
    size: IntVolumeSize,
    space: IntVolumeSize,
    layoutDirection: LayoutDirection
): Vector3

Provides the origin-based position of the content in the available space.

Parameters
size: IntVolumeSize

The content size in pixels.

space: IntVolumeSize

The available space in pixels.

layoutDirection: LayoutDirection

LTR or RTL.