Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrFramebufferOverflow = errors.New("framebuffer overflow")
ErrFramebufferOverflow is returned when the framebuffer is full.
Functions ¶
This section is empty.
Types ¶
type Frame ¶
type Frame[Image any] struct { Image Image JumpBackAmount int32 DurationMs Milliseconds }
Frame is a single frame of an animation.
type Milliseconds ¶
type Milliseconds uint32
Milliseconds is a duration in milliseconds.
func DurationToMs ¶
func DurationToMs(d time.Duration) Milliseconds
DurationToMs converts a time.Duration to Milliseconds. The duration is rounded down to the nearest millisecond.
type Player ¶
Player is an animation player. It is safe to use from multiple goroutines.
func NewPlayerWithSize ¶
NewPlayerWithSize creates a new animation player that can hold up to maxFrames frames.
func (*Player[Image]) AddFrame ¶
AddFrames adds a frame to the animation. If the player is full, the function blocks until there is room for the frame.
Click to show internal directories.
Click to hide internal directories.