Entry point composable. Two overloads:
Param Type Default Description modifier Modifier Modifier Standard Compose modifier config SceneConfig SceneConfig() Scene configuration content IsometricScope.() -> Unit — Scene content
Param Type Default Description geometry Shape — Required. The 3D shape geometry color IsoColor LocalDefaultColor Shape color position Point Point(0,0,0) Additional position offset rotation Double 0.0 Rotation angle in radians scale Double 1.0 Uniform scale factor rotationOrigin Point? null Center of rotation scaleOrigin Point? null Center of scale visible Boolean true Visibility toggle
Param Type Default Description position Point Point(0,0,0) Group position offset rotation Double 0.0 Group rotation (applied to all children) scale Double 1.0 Group scale (applied to all children) rotationOrigin Point? null Center of rotation scaleOrigin Point? null Center of scale visible Boolean true Visibility toggle for entire group renderOptions RenderOptions? null Override render options for this subtree content IsometricScope.() -> Unit — Child shapes and groups
Transforms accumulate through the hierarchy. A shape inside a rotated group inherits the group’s rotation.
Renders a 2D polygon face positioned in 3D space. Used for flat surfaces like floors, walls, or labels.
Param Type Default Description path Path — Required. The 2D polygon face color IsoColor LocalDefaultColor Face color position Point Point(0,0,0) Additional position offset rotation Double 0.0 Rotation angle in radians scale Double 1.0 Uniform scale factor rotationOrigin Point? null Center of rotation scaleOrigin Point? null Center of scale visible Boolean true Visibility toggle
Takes shapes: List<Shape> instead of single geometry. Efficient for rendering many shapes with the same transforms.
Param Type Default Description shapes List<Shape> — Required. Shapes to render color IsoColor LocalDefaultColor Color applied to all shapes position Point Point(0,0,0) Position offset rotation Double 0.0 Rotation angle scale Double 1.0 Scale factor rotationOrigin Point? null Center of rotation scaleOrigin Point? null Center of scale visible Boolean true Visibility toggle
// Render many shapes efficiently with shared transforms
val buildings = ( 0 until 10 ). map { i ->
Prism (position = Point (i * 2.0 , 0.0 , 0.0 ))
color = IsoColor ( 33 , 150 , 243 ),
position = Point ( - 10.0 , 0.0 , 0.0 )
Param Type Description condition Boolean When false, children are removed from the scene graph content IsometricScope.() -> Unit Content to conditionally render
var showRoof by remember { mutableStateOf ( true ) }
Shape (geometry = Pyramid ( Point ( 0.0 , 0.0 , 2.0 )), color = IsoColor.RED)
Param Type Description items List<T> Items to iterate key ((T) -> Any)? Optional key function for stable identity content IsometricScope.(T) -> Unit Content for each item
ForEach (items = buildings, key = { it.id }) { building ->
Shape (geometry = Prism ( Point (building.x, building.y, 0.0 )), color = building.color)
Escape hatch for custom rendering. Takes a render lambda that returns List<RenderCommand>.
IsometricScope extension composable. Renders a width × height isometric tile grid and routes
tap events to tile coordinates. No GestureConfig is required on the enclosing IsometricScene
when onTileClick is provided — gesture handling activates automatically.
Param Type Default Description widthInt— Required. Number of tile columns. Must be ≥ 1. heightInt— Required. Number of tile rows. Must be ≥ 1. configTileGridConfigTileGridConfig()Tile size, world origin, optional per-tile elevation. onTileClick((TileCoordinate) -> Unit)?nullCalled when the user taps a tile within the grid bounds. content@Composable IsometricScope.(TileCoordinate) -> Unit— Required. Rendered in each tile’s local coordinate space.
onTileClick = { coord -> selectedTile = coord }
geometry = Prism (Point.ORIGIN),
color = if (coord == selectedTile) IsoColor ( 33 , 150 , 243 ) else IsoColor ( 200 , 200 , 200 )
IsometricScope extension composable. Arranges count children at equal gap spacing along
a world axis.
Param Type Default Description countInt— Required. Number of children. Must be ≥ 1. axisStackAxisStackAxis.ZWorld axis along which children are arranged. gapDouble1.0World-unit distance between consecutive child origins. Must be non-zero and finite. Negative values reverse direction. content@Composable IsometricScope.(index: Int) -> Unit— Required. Receives zero-based index.
Stack (count = 5 , axis = StackAxis.Z, gap = 1.0 ) { floor ->
Shape (geometry = Prism (Point.ORIGIN), color = IsoColor ( 33 , 150 , floor * 40 ))