animation

package
v0.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 15, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Animation

type Animation struct {
	// contains filtered or unexported fields
}

Animation is an animation loop running at 33Hz. We supply pre and post events for applying animation changes between frames.

func (*Animation) OnAfter

func (a *Animation) OnAfter(handler Handler) Animator

OnAfter handlers are called after every OnFrame handler call.

func (*Animation) OnBefore

func (a *Animation) OnBefore(handler Handler) Animator

OnBefore handlers are called before the OnFrame handlers are called.

func (*Animation) OnFrame

func (a *Animation) OnFrame(handler Handler) Animator

OnFrame handlers are called at a frequency of 33Hz.

func (*Animation) Start

func (a *Animation) Start() Animator

Start makes an animation loop call the OnFrame handlers at 33 Hz.

func (*Animation) Stop

func (a *Animation) Stop()

Stop makes the animation stop calling the OnFrame handlers.

type Animator

type Animator interface {
	Start() Animator
	Stop()
	OnBefore(handler Handler) Animator
	OnFrame(handler Handler) Animator
	OnAfter(handler Handler) Animator
}

type Handler

type Handler func(t, dt time.Duration)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL