Skip to content
On this page
通用

ClientItemRenderAnimation

top.katton.apicommon/src/main/kotlin/top/katton/api/ClientItemRenderAnimation.kt
动画轨道上的变换关键帧。[time] 通常取 0.0 到 1.0。

ClientItemRenderEasing

ClientItemRenderEasing通用枚举类
kotlin
enum class ClientItemRenderEasing(private val sampler: (Float) -> Float)

ClientItemRenderEasing.apply

ClientItemRenderEasing.apply通用函数
kotlin
fun apply(progress: Float): Float

只限制输入进度。采样结果会保留原始值, 因此 back、elastic、bounce 等会越界的曲线仍能保持原本形状。

ClientItemRenderAnimationKeyframe

ClientItemRenderAnimationKeyframe通用数据类
kotlin
data class ClientItemRenderAnimationKeyframe( override val time: Float, val value: Vec3, val easing: ClientItemRenderEasing

动画轨道上的变换关键帧。[time] 通常取 0.0 到 1.0。

平移值表示方块偏移,旋转值表示角度,缩放值表示倍率。

ClientItemRenderFunctionKeyframe

ClientItemRenderFunctionKeyframe通用数据类
kotlin
data class ClientItemRenderFunctionKeyframe( override val time: Float, val function: (ClientItemRenderMarker) -> Unit ) : ClientItemRenderKeyframe

仅在客户端本地执行的函数关键帧。函数回调不会通过网络序列化, 因此服务端生成的标记只能传输变换关键帧。

ClientItemRenderAnimation

ClientItemRenderAnimation通用数据类
kotlin
data class ClientItemRenderAnimation( val target: ClientItemRenderAnimationTarget, val mode: ClientItemRenderAnimationMode

[ClientItemRenderAnimationSet] 内的一条动画轨道。

ClientItemRenderAnimationSet

ClientItemRenderAnimationSet通用数据类
kotlin
data class ClientItemRenderAnimationSet( val animations: List<ClientItemRenderAnimation>, val durationTicks: Int, val delayTicks: Int

可播放的动画集。此集合中的所有轨道共享相同的持续时间、 延迟和循环行为。多个动画集可以同时播放并叠加。