---
title: "SceneCoreEntitySizeAdapter"
description: "The sizing strategy used by SceneCoreEntity to control and read the size of an entity."
type: "function"
lastmod: "2026-05-08T01:17:01.366664Z"
---
## API Reference

### SceneCoreEntitySizeAdapter

> **Deprecated** SceneCoreEntitySizeAdapter is now an interface and intrinsicSize has been renamed to currentSize.

> Source set: Android

```kotlin
public fun <T : Entity> SceneCoreEntitySizeAdapter(
    onLayoutSizeChanged: T.(IntVolumeSize) -> Unit,
    intrinsicSize: (T.() -> IntVolumeSize)? = null,
): SceneCoreEntitySizeAdapter<T>
```

The sizing strategy used by [SceneCoreEntity](/jetpack-compose/androidx.xr.compose/compose/composable-functions/SceneCoreEntity) to control and read the size of an entity.

The developer should use `onLayoutSizeChanged` to apply compose layout size changes to the
entity. Compose will not inherently affect the size of the `Entity`.

If the developer uses `onLayoutSizeChanged` to change the size of the entity, but [intrinsicSize](/jetpack-compose/androidx.compose.foundation/foundation-layout/classes/IntrinsicSize)
is not provided, then the intrinsic size of the entity will be ignored and the layout size as
determined solely by compose will be used to size the entity. If the [SceneCoreEntity](/jetpack-compose/androidx.xr.compose/compose/composable-functions/SceneCoreEntity) has no
children or size modifiers then compose doesn't know how to size this node and it will be size 0,
causing it not to render at all. In such a case, please do one of the following: (1) provide
[intrinsicSize](/jetpack-compose/androidx.compose.foundation/foundation-layout/classes/IntrinsicSize) so compose can infer the size from the entity, (2) add a sizing modifier to
control the size of the entity, or (3) remove the adapter from the [SceneCoreEntity](/jetpack-compose/androidx.xr.compose/compose/composable-functions/SceneCoreEntity) as without
an adapter compose will not try to control the size of this entity.

Note that many SceneCore entities accept sizes in meter units instead of pixels. The [Meter](/jetpack-compose/androidx.xr.compose/compose/classes/Meter) type
may be used to convert from pixels to meters.

```kotlin
Meter.fromPixel(px, density).toM()
```

Deprecated constructor function to maintain backwards compatibility after changing
SceneCoreEntitySizeAdapter from a class to an interface.

#### Parameters

| | |
| --- | --- |
| onLayoutSizeChanged | a callback that is invoked with the final layout size of the composable in pixels. |
| intrinsicSize | a getter method that returns the current [IntVolumeSize](/jetpack-compose/androidx.xr.compose/compose/classes/IntVolumeSize) in pixels of the entity. This isn't as critical for compose as `onLayoutSizeChanged`; however, this can help to inform compose of the intrinsic size of the entity. |
