Skip to content

Composables Reference

Entry point composable. Two overloads:

ParamTypeDefaultDescription
modifierModifierModifierStandard Compose modifier
configSceneConfigSceneConfig()Scene configuration
contentIsometricScope.() -> UnitScene content
ParamTypeDefaultDescription
geometryShapeRequired. The 3D shape geometry
colorIsoColorLocalDefaultColorShape color
positionPointPoint(0,0,0)Additional position offset
rotationDouble0.0Rotation angle in radians
scaleDouble1.0Uniform scale factor
rotationOriginPoint?nullCenter of rotation
scaleOriginPoint?nullCenter of scale
visibleBooleantrueVisibility toggle
ParamTypeDefaultDescription
positionPointPoint(0,0,0)Group position offset
rotationDouble0.0Group rotation (applied to all children)
scaleDouble1.0Group scale (applied to all children)
rotationOriginPoint?nullCenter of rotation
scaleOriginPoint?nullCenter of scale
visibleBooleantrueVisibility toggle for entire group
renderOptionsRenderOptions?nullOverride render options for this subtree
contentIsometricScope.() -> UnitChild 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.

ParamTypeDefaultDescription
pathPathRequired. The 2D polygon face
colorIsoColorLocalDefaultColorFace color
positionPointPoint(0,0,0)Additional position offset
rotationDouble0.0Rotation angle in radians
scaleDouble1.0Uniform scale factor
rotationOriginPoint?nullCenter of rotation
scaleOriginPoint?nullCenter of scale
visibleBooleantrueVisibility toggle

Takes shapes: List<Shape> instead of single geometry. Efficient for rendering many shapes with the same transforms.

ParamTypeDefaultDescription
shapesList<Shape>Required. Shapes to render
colorIsoColorLocalDefaultColorColor applied to all shapes
positionPointPoint(0,0,0)Position offset
rotationDouble0.0Rotation angle
scaleDouble1.0Scale factor
rotationOriginPoint?nullCenter of rotation
scaleOriginPoint?nullCenter of scale
visibleBooleantrueVisibility 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))
}
Batch(
shapes = buildings,
color = IsoColor(33, 150, 243),
position = Point(-10.0, 0.0, 0.0)
)
ParamTypeDescription
conditionBooleanWhen false, children are removed from the scene graph
contentIsometricScope.() -> UnitContent to conditionally render
var showRoof by remember { mutableStateOf(true) }
// ...
If(showRoof) {
Shape(geometry = Pyramid(Point(0.0, 0.0, 2.0)), color = IsoColor.RED)
}
ParamTypeDescription
itemsList<T>Items to iterate
key((T) -> Any)?Optional key function for stable identity
contentIsometricScope.(T) -> UnitContent 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.

ParamTypeDefaultDescription
widthIntRequired. Number of tile columns. Must be ≥ 1.
heightIntRequired. 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) -> UnitRequired. Rendered in each tile’s local coordinate space.
TileGrid(
width = 10,
height = 10,
onTileClick = { coord -> selectedTile = coord }
) { coord ->
Shape(
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.

ParamTypeDefaultDescription
countIntRequired. 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) -> UnitRequired. 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))
}