ZActionPlayer

Allows playback of skeletal actions stored in ZSkeletalAction.

Playback is bound to a ZSkeleton: this class owns the clock (time, speed, loop, play state) and commits the sampled clip pose to that skeleton inside update each frame (wall clock or explicit update with elapsed seconds). Typical host integration: call update once per frame before skinning or render.

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard

Current playback time in seconds (writable only inside this player).

Link copied to clipboard

Total duration of the current action in seconds, or 0 if none.

Link copied to clipboard

Whether the action is currently playing (writable only inside this player).

Functions

Link copied to clipboard
Link copied to clipboard
fun pause()

Pauses playback without resetting currentTime.

Link copied to clipboard
fun play(loop: Boolean = false)

Starts playing the current action.

Link copied to clipboard

Resets the internal wall-clock baseline used by update.

Link copied to clipboard
fun seek(time: Float)

Seeks to time (clamped to the clip range) and reapplies the pose at that time.

Link copied to clipboard
fun setAction(skeleton: ZSkeleton, action: ZSkeletalAction)

Sets the skeleton and clip to play, resets playback time to zero, and applies the pose at time 0 so the skeleton matches the start of the clip immediately.

Link copied to clipboard

Sets the playback speed multiplier.

Link copied to clipboard
fun stop()

Stops playback, resets time to the start of the clip, and reapplies the pose at time 0.

Link copied to clipboard
fun update()

Updates playback using elapsed wall time since the last call (seconds), then commits the sampled pose to skeleton.

fun update(deltaTimeSeconds: Float)

Advances playback by deltaTimeSeconds (scaled by playbackSpeed when playing), then commits the sampled pose to skeleton. Use for fixed-step or injected delta time instead of wall-clock update.