Skip to content
On this page
Common

SceneClientApi

top.katton.api.scenecommon/src/main/kotlin/top/katton/api/scene/SceneClientApi.kt
Register a client definition, owned by the current script. Version defaults to the script pack's code hash.

registerClientScene ​

registerClientSceneCommonFunction
kotlin
fun registerClientScene(id: String, revision: String = ScriptExecutionContext.currentScriptRevision() ?: "1", block: SceneBuilder.() -> Unit)

Register a client definition, owned by the current script. Version defaults to the script pack's code hash.

unregisterClientScene ​

unregisterClientSceneCommonFunction
kotlin
fun unregisterClientScene(id: String): Boolean

Stop instances and unregister this definition.

playClientScene ​

playClientSceneCommonFunction
kotlin
fun playClientScene(id: String, context: SceneContext = SceneContext()): SceneHandle

Play locally on the client thread.

playClientEffect ​

playClientEffectCommonFunction
kotlin
fun playClientEffect(effect: SceneEffect, context: SceneContext = SceneContext()): EffectHandle

Every standalone effect uses the same ownership and cancellation rules as scenes.

playCameraPath ​

playCameraPathCommonFunction
kotlin
fun playCameraPath(keyframes: List<CameraKeyframe>, options: CameraOptions = CameraOptions()): EffectHandle

Play a world-space camera path; keyframe times are ticks and angles are degrees.

followCamera ​

followCameraCommonFunction
kotlin
fun followCamera(anchor: EffectAnchor, durationTicks: Int, options: CameraOptions = CameraOptions(), context: SceneContext = SceneContext()): EffectHandle

Follow an anchor until the duration expires or the target becomes unavailable.

shakeCamera ​

shakeCameraCommonFunction
kotlin
fun shakeCamera(durationTicks: Int = 10, strength: Float = 2f, frequency: Float = 0.7f): EffectHandle

Add a decaying angular shake without locking player input.

transitionCameraFov ​

transitionCameraFovCommonFunction
kotlin
fun transitionCameraFov(from: Float, to: Float, durationTicks: Int, easing: SceneEasing = SceneEasing.SMOOTH): EffectHandle

Interpolate the rendered FOV in degrees without changing saved video options.

setClientEffectBudgets ​

setClientEffectBudgetsCommonFunction
kotlin
fun setClientEffectBudgets(budgets: EffectBudgets)

Set shared client limits for active effects, emitted particles, and geometry vertices.