Android
public interface SpatialAlignment
An interface to calculate the position of a sized box inside of an available 3D space. SpatialAlignment is often used to define the alignment of a layout inside a parent layout.
Functions
horizontalOffset
public fun horizontalOffset(
width: Int,
space: Int,
layoutDirection: LayoutDirection = LayoutDirection.Ltr,
): Int
Provides the horizontal offset from the origin of the space to the origin of the content.
Parameters
| width | The content width in pixels. |
| space | The available space in pixels. |
| layoutDirection | LTR or RTL. |
verticalOffset
public fun verticalOffset(height: Int, space: Int): Int
Provides the vertical offset from the origin of the space to the origin of the content.
Parameters
| height | The content height in pixels. |
| space | The available space in pixels. |
depthOffset
public fun depthOffset(depth: Int, space: Int): Int
Provides the depth offset from the origin of the space to the origin of the content.
Parameters
| depth | The content depth in pixels. |
| space | The available space in pixels. |
position
public fun position(
size: IntVolumeSize,
space: IntVolumeSize,
layoutDirection: LayoutDirection = LayoutDirection.Ltr,
): Vector3
Provides the origin-based position of the content in the available space.
Parameters
| size | The content size in pixels. |
| space | The available space in pixels. |
| layoutDirection | LTR or RTL. |