SceneCoreEntity
Android
@Composable
@SubspaceComposable
public fun <T : Entity> SceneCoreEntity(
factory: () -> T,
modifier: SubspaceModifier = SubspaceModifier,
update: (T) -> Unit = {},
sizeAdapter: SceneCoreEntitySizeAdapter<T>? = null,
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.
Usage of this API requires the SceneCore dependency to be added. See https://developer.android.com/jetpack/androidx/releases/xr-scenecore
Parameters
| factory | the factory method for creating the SceneCore Entity. |
| modifier | the SubspaceModifier that will be applied to this node. |
| update | 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 | 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 | the children of this Entity. |