# SubspaceMeasureScope

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/SubspaceMeasureScope.kt+class:androidx.xr.compose.subspace.layout.SubspaceMeasureScope) Added in [1.0.0-beta02](https://developer.android.com/jetpack/androidx/releases/xr-compose#1.0.0-beta02)


```
interface SubspaceMeasureScope : Density
```

<br />

*** ** * ** ***

The receiver scope of a layout's measure lambda. The return value of the measure lambda is `https://developer.android.com/reference/kotlin/androidx/xr/compose/subspace/layout/SubspaceMeasureResult`, which should be returned by `https://developer.android.com/reference/kotlin/androidx/xr/compose/subspace/layout/SubspaceMeasureScope#layout(kotlin.Int,kotlin.Int,kotlin.Int,kotlin.Function1)`

Based on `https://developer.android.com/reference/kotlin/androidx/compose/ui/layout/MeasureScope`.

## Summary

| ### Public functions |
|---|---|
| `open https://developer.android.com/reference/kotlin/androidx/xr/compose/subspace/layout/SubspaceMeasureResult` | `https://developer.android.com/reference/kotlin/androidx/xr/compose/subspace/layout/SubspaceMeasureScope#layout(kotlin.Int,kotlin.Int,kotlin.Int,kotlin.Function1)(width: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, height: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, depth: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, placementBlock: https://developer.android.com/reference/kotlin/androidx/xr/compose/subspace/layout/SubspacePlaceable.SubspacePlacementScope.() -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)` Sets the size and alignment lines of the measured layout, as well as the positioning block that defines the children positioning logic. |

| ### Public properties |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/LayoutDirection` | `https://developer.android.com/reference/kotlin/androidx/xr/compose/subspace/layout/SubspaceMeasureScope#layoutDirection()` The `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/LayoutDirection` of the `Layout` or `LayoutModifier` using the measure scope to measure their children. |

### Inherited functions

From [androidx.compose.ui.unit.Density](https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Density) `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp.https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Density#(androidx.compose.ui.unit.Dp).roundToPx()()` `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/TextUnit.https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Density#(androidx.compose.ui.unit.TextUnit).roundToPx()()` `open https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html.https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Density#(kotlin.Int).toDp()()` `open https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html.https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Density#(kotlin.Float).toDp()()` `open https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/DpSize` `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Size.https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Density#(androidx.compose.ui.geometry.Size).toDpSize()()` `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp.https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Density#(androidx.compose.ui.unit.Dp).toPx()()` `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/TextUnit.https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Density#(androidx.compose.ui.unit.TextUnit).toPx()()` `open https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Rect` `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/DpRect.https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Density#(androidx.compose.ui.unit.DpRect).toRect()()` `open https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Size` `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/DpSize.https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Density#(androidx.compose.ui.unit.DpSize).toSize()()` `open https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/TextUnit` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html.https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Density#(kotlin.Int).toSp()()` `open https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/TextUnit` `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html.https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Density#(kotlin.Float).toSp()()` From [androidx.compose.ui.unit.FontScaling](https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/FontScaling) `open https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp` `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/TextUnit.https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/FontScaling#(androidx.compose.ui.unit.TextUnit).toDp()()` `open https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/TextUnit` `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Dp.https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/FontScaling#(androidx.compose.ui.unit.Dp).toSp()()`

### Inherited properties

From [androidx.compose.ui.unit.Density](https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Density) `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Density#density()` From [androidx.compose.ui.unit.FontScaling](https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/FontScaling) `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/FontScaling#fontScale()`

## Public functions

### layout

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

```
open fun layout(width: Int, height: Int, depth: Int, placementBlock: SubspacePlaceable.SubspacePlacementScope.() -> Unit): SubspaceMeasureResult
```

Sets the size and alignment lines of the measured layout, as well as the positioning block that defines the children positioning logic. The `https://developer.android.com/reference/kotlin/androidx/xr/compose/subspace/layout/SubspaceMeasureScope#layout(kotlin.Int,kotlin.Int,kotlin.Int,kotlin.Function1)` is a lambda used for positioning children. `https://developer.android.com/reference/kotlin/androidx/xr/compose/subspace/layout/SubspacePlaceable#placeAt(androidx.xr.runtime.math.Pose)` should be called on children inside placementBlock.

| Parameters |
|---|---|
| `width: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | the measured width of the layout, in pixels |
| `height: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | the measured height of the layout, in pixels |
| `depth: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | the measured depth of the layout, in pixels |
| `placementBlock: https://developer.android.com/reference/kotlin/androidx/xr/compose/subspace/layout/SubspacePlaceable.SubspacePlacementScope.() -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | block defining the children positioning of the current layout |

## Public properties

### layoutDirection

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

```
val layoutDirection: LayoutDirection
```

The `https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/LayoutDirection` of the `Layout` or `LayoutModifier` using the measure scope to measure their children.