TextAnim

class TextAnim : Anim

An Anim that renders some text, which gets updated on each new frame.

To reference a text animation, just convert it to a string inside a Section.

Using one looks like this:

session {
val waitingAnim = textAnimOf(listOf("", ".", "..", "..."), frameDuration = 250.milliseconds)
section {
text("Thinking$waitingAnim")
}.runUntilSignal { ... }
}

Types

Link copied to clipboard
class Template(val frames: List<String>, val frameDuration: Duration, val looping: Boolean = true)

A template for a text animation, useful if you want to define an animation once but instantiate several copies of it throughout your program.

Properties

Link copied to clipboard

Manually set the current frame (0-indexed) that this animation should display.

Link copied to clipboard

Returns whether this animation is currently active or not.

Link copied to clipboard

The last frame (0 -indexed) in this animation.

Link copied to clipboard

How many frames this animation has.

Link copied to clipboard

Whether this animation is paused or not.

Link copied to clipboard

The total duration of this animation if all frames are played once.

Functions

Link copied to clipboard
open override fun toString(): String

Returns the current frame of text.