IsometricRenderer

class IsometricRenderer(engine: SceneProjector, enablePathCaching: Boolean = false, enableSpatialIndex: Boolean = true, spatialIndexCellSize: Double = DEFAULT_SPATIAL_INDEX_CELL_SIZE) : Closeable

Renderer that converts the isometric node tree to visual output using a SceneProjector for projection and depth sorting.

Coordinates between focused collaborators:

Platform notes:

Constructors

Link copied to clipboard
constructor(engine: SceneProjector, enablePathCaching: Boolean = false, enableSpatialIndex: Boolean = true, spatialIndexCellSize: Double = DEFAULT_SPATIAL_INDEX_CELL_SIZE)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Optional benchmark hooks for instrumentation. Set via IsometricScene's DisposableEffect from LocalBenchmarkHooks. Null in production (zero overhead).

Link copied to clipboard

When true, forces a cache rebuild every frame (disables PreparedScene caching). Used by benchmarks to measure projectScene() cost independently of caching.

Link copied to clipboard
var onRenderError: (commandId: String, error: Throwable) -> Unit?

Optional callback invoked when a render command fails to draw. Receives the command ID and the exception. The command is skipped. Null in production (errors are silently skipped).

Functions

Link copied to clipboard

Invalidate cache (call when render options change).

Link copied to clipboard
open override fun close()

Release all cached resources. Idempotent — safe to call multiple times. After close(), the renderer must not be used for rendering; any attempt will throw IllegalStateException.

Link copied to clipboard
fun hitTest(rootNode: GroupNode, x: Double, y: Double, context: RenderContext, width: Int, height: Int): IsometricNode?

Perform hit testing with optional spatial indexing.

Link copied to clipboard
fun DrawScope.render(rootNode: GroupNode, context: RenderContext, strokeStyle: StrokeStyle = StrokeStyle.FillAndStroke())

Render the node tree to a DrawScope with path caching.

Link copied to clipboard
fun DrawScope.renderNative(rootNode: GroupNode, context: RenderContext, strokeStyle: StrokeStyle = StrokeStyle.FillAndStroke())

Render using native Android canvas (2x faster, Android-only).