Getting Started
Install
dependencies { implementation("io.github.damianpetla:physics-scene:0.1.0")}Minimal scene
val sceneState = rememberPhysicsSceneState()
PhysicsScene( state = sceneState, onEvent = { event -> when (event) { is BodyRemoved -> println("Removed ${event.id}") else -> Unit } }) { Button( onClick = { sceneState.activateBody("cta") }, modifier = Modifier.physicsBody( id = "cta", effect = FallingShatterEffect() ) ) { Text("Drop") }}What to read next
PhysicsScenefor host behavior.Modifier.physicsBodyfor registration rules.PhysicsSceneStatefor commands and snapshots.Effects Overviewto choose a preset.