SceneCoreEntity

Functions summary

Unit
@Composable
@SubspaceComposable
<T : Entity> SceneCoreEntity(
    factory: () -> T,
    modifier: SubspaceModifier,
    update: (T) -> Unit,
    sizeAdapter: SceneCoreEntitySizeAdapter<T>?,
    content: @Composable @SubspaceComposable () -> Unit
)

A composable that attaches to a SceneCore entity and allow compose to size, position, reparent, add children, and apply modifiers to the entity.

Functions

SceneCoreEntity

@Composable
@SubspaceComposable
fun <T : Entity> SceneCoreEntity(
    factory: () -> T,
    modifier: SubspaceModifier = SubspaceModifier,
    update: (T) -> Unit = {},
    sizeAdapter: SceneCoreEntitySizeAdapter<T>? = null,
    content: @Composable @SubspaceComposable () -> Unit = {}
): Unit

A composable that attaches to a SceneCore entity and allow compose to size, position, reparent, add children, and apply modifiers to the entity.

Usage of this API requires the SceneCore dependency to be added. See https://developer.android.com/jetpack/androidx/releases/xr-scenecore

Parameters
factory: () -> T

the factory method for creating the SceneCore Entity.

modifier: SubspaceModifier = SubspaceModifier

the SubspaceModifier that will be applied to this node.

update: (T) -> Unit = {}

a callback to be invoked on recomposition to apply any state changes to the Entity. This will track snapshot state reads and call update when they change.

sizeAdapter: SceneCoreEntitySizeAdapter<T>? = null

an adapter that allows compose to integrate its layout size changes with the rendered entity size. This adapter implementation will likely be different for every entity and some SceneCore entities may not require sizing at all (this may be null).

content: @Composable @SubspaceComposable () -> Unit = {}

the children of this Entity.

See also
SceneCoreEntitySizeAdapter

for more information on how compose sizes SceneCore entities.