# SpatialBiasAlignment

Artifact: [androidx.xr.compose:compose](https://developer.android.com/jetpack/androidx/releases/xr-compose) [View Source](https://cs.android.com/search?q=file:androidx/xr/compose/subspace/layout/SpatialAlignment.kt+class:androidx.xr.compose.subspace.layout.SpatialBiasAlignment) Added in [1.0.0-beta02](https://developer.android.com/jetpack/androidx/releases/xr-compose#1.0.0-beta02)


```
class SpatialBiasAlignment : SpatialAlignment
```

<br />

*** ** * ** ***

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

Bias refers to a normalized floating-point value, typically within the range of -1.0f, 1.0f, that determines how a child's content is positioned along a specific axis relative to its parent's available space.

- A bias of 0.0f centers the content along that axis.

- A bias of -1.0f aligns the content to one extreme (e.g., start for horizontal, bottom for vertical, back for depth).

- A bias of 1.0f aligns the content to the opposite extreme (e.g., end for horizontal, top for vertical, front for depth).

- Values between -1.0f and 1.0f linearly interpolate the position between these extremes.

## Summary

| ### Nested types |
|---|
| `class https://developer.android.com/reference/kotlin/androidx/xr/compose/subspace/layout/SpatialBiasAlignment.Depth : https://developer.android.com/reference/kotlin/androidx/xr/compose/subspace/layout/SpatialAlignment.Depth` Creates a weighted alignment that specifies a depth bias. |
| `class https://developer.android.com/reference/kotlin/androidx/xr/compose/subspace/layout/SpatialBiasAlignment.Horizontal : https://developer.android.com/reference/kotlin/androidx/xr/compose/subspace/layout/SpatialAlignment.Horizontal` Creates a weighted alignment that specifies a horizontal bias. |
| `class https://developer.android.com/reference/kotlin/androidx/xr/compose/subspace/layout/SpatialBiasAlignment.Vertical : https://developer.android.com/reference/kotlin/androidx/xr/compose/subspace/layout/SpatialAlignment.Vertical` Creates a weighted alignment that specifies a vertical bias. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/xr/compose/subspace/layout/SpatialBiasAlignment#SpatialBiasAlignment(kotlin.Float,kotlin.Float,kotlin.Float)( horizontalBias: @https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange(from = -1.0, to = 1.0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, verticalBias: @https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange(from = -1.0, to = 1.0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, depthBias: @https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange(from = -1.0, to = 1.0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html )` |

| ### Public functions |
|---|---|
| `open https://developer.android.com/reference/kotlin/androidx/xr/runtime/math/Vector3` | `https://developer.android.com/reference/kotlin/androidx/xr/compose/subspace/layout/SpatialBiasAlignment#align(androidx.xr.compose.unit.IntVolumeSize,androidx.xr.compose.unit.IntVolumeSize,androidx.compose.ui.unit.LayoutDirection)( size: https://developer.android.com/reference/kotlin/androidx/xr/compose/unit/IntVolumeSize, space: https://developer.android.com/reference/kotlin/androidx/xr/compose/unit/IntVolumeSize, layoutDirection: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/LayoutDirection )` Provides the origin-based position of the content in the available space. |
| `https://developer.android.com/reference/kotlin/androidx/xr/compose/subspace/layout/SpatialBiasAlignment` | `https://developer.android.com/reference/kotlin/androidx/xr/compose/subspace/layout/SpatialBiasAlignment#copy(kotlin.Float,kotlin.Float,kotlin.Float)(horizontalBias: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, verticalBias: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, depthBias: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` |
| `open operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/compose/subspace/layout/SpatialBiasAlignment#equals(kotlin.Any)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/compose/subspace/layout/SpatialBiasAlignment#hashCode()()` |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/compose/subspace/layout/SpatialBiasAlignment#toString()()` |

| ### Public properties |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/compose/subspace/layout/SpatialBiasAlignment#depthBias()` Must be within the range of -1, 1 with -1 being back and 1 being front. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/compose/subspace/layout/SpatialBiasAlignment#horizontalBias()` Must be within the range of -1, 1 with -1 being start and 1 being end. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/compose/subspace/layout/SpatialBiasAlignment#verticalBias()` Must be within the range of -1, 1 with -1 being bottom and 1 being top. |

## Public constructors

### SpatialBiasAlignment

Added in [1.0.0-beta02](https://developer.android.com/jetpack/androidx/releases/xr-compose#1.0.0-beta02)

```
SpatialBiasAlignment(
    horizontalBias: @FloatRange(from = -1.0, to = 1.0) Float,
    verticalBias: @FloatRange(from = -1.0, to = 1.0) Float,
    depthBias: @FloatRange(from = -1.0, to = 1.0) Float
)
```

| Parameters |
|---|---|
| `horizontalBias: @https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange(from = -1.0, to = 1.0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | Must be within the range of -1, 1 with -1 being start and 1 being end. |
| `verticalBias: @https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange(from = -1.0, to = 1.0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | Must be within the range of -1, 1 with -1 being bottom and 1 being top. |
| `depthBias: @https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange(from = -1.0, to = 1.0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | Must be within the range of -1, 1 with -1 being back and 1 being front. |

## Public functions

### align

```
open fun align(
    size: IntVolumeSize,
    space: IntVolumeSize,
    layoutDirection: LayoutDirection
): Vector3
```

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

| Parameters |
|---|---|
| `size: https://developer.android.com/reference/kotlin/androidx/xr/compose/unit/IntVolumeSize` | The content size in pixels. |
| `space: https://developer.android.com/reference/kotlin/androidx/xr/compose/unit/IntVolumeSize` | The available space in pixels. |
| `layoutDirection: https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/LayoutDirection` | LTR or RTL. |

### copy

Added in [1.0.0-beta02](https://developer.android.com/jetpack/androidx/releases/xr-compose#1.0.0-beta02)

```
fun copy(
    horizontalBias: Float = this.horizontalBias,
    verticalBias: Float = this.verticalBias,
    depthBias: Float = this.depthBias
): SpatialBiasAlignment
```

### equals

```
open operator fun equals(other: Any?): Boolean
```

### hashCode

```
open fun hashCode(): Int
```

### toString

```
open fun toString(): String
```

## Public properties

### depthBias

Added in [1.0.0-beta02](https://developer.android.com/jetpack/androidx/releases/xr-compose#1.0.0-beta02)

```
val depthBias: Float
```

Must be within the range of -1, 1 with -1 being back and 1 being front.

### horizontalBias

Added in [1.0.0-beta02](https://developer.android.com/jetpack/androidx/releases/xr-compose#1.0.0-beta02)

```
val horizontalBias: Float
```

Must be within the range of -1, 1 with -1 being start and 1 being end.

### verticalBias

Added in [1.0.0-beta02](https://developer.android.com/jetpack/androidx/releases/xr-compose#1.0.0-beta02)

```
val verticalBias: Float
```

Must be within the range of -1, 1 with -1 being bottom and 1 being top.