animation

package
v0.0.0-...-4d18667 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package animation provides functionality to animate graphic primitives on the screen.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Tween

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

Tween interpolates two Params over time. Use NewTween() to create a new Tween.

func NewTween

func NewTween(start, end *gfx.Params, duration time.Duration, offset time.Duration, looping bool) *Tween

NewTween returns a new Tween for two Params, where start and end are the two Params to be interpolated. offset indicates the duration after which the interpolation starts. looping indicates if the interpolation should go back to the beginning when the end is reached.

func (*Tween) Finished

func (t *Tween) Finished() bool

Finished indicates if the animation is at the end.

func (*Tween) GetParams

func (t *Tween) GetParams() *gfx.Params

GetParams returns the interpolated Params.

func (*Tween) Update

func (t *Tween) Update(delta time.Duration)

Update updates the tweened Params.

Jump to

Keyboard shortcuts

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