animation

package
v0.17.1 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultCurve = LinearCurve{}
View Source
var EaseIn = CubicBezierCurve{0.3, 0, 1, 1}
View Source
var EaseInOut = CubicBezierCurve{0.65, 0, 0.35, 1}

TODO: figure out if what curve to use here. unless we're going back to Ivo's curve (0.3, 0, 0, 1), make sure to update the unit tests

var EaseInOut = CubicBezierCurve{0.3, 0, 0, 1}

View Source
var EaseOut = CubicBezierCurve{0, 0, 0, 1}

Functions

This section is empty.

Types

type AnimatedPositioned

type AnimatedPositioned struct {
	render.Widget
	Child    render.Widget `starlark:"child,required"`
	XStart   int           `starlark:"x_start"`
	XEnd     int           `starlark:"x_end"`
	YStart   int           `starlark:"y_start"`
	YEnd     int           `starlark:"y_end"`
	Duration int           `starlark:"duration,required"`
	Curve    Curve         `starlark:"curve,required"`
	Delay    int           `starlark:"delay"`
	Hold     int           `starlark:"hold"`
}

Animate a widget from start to end coordinates.

DOC(Child): Widget to animate DOC(XStart): Horizontal start coordinate DOC(XEnd): Horizontal end coordinate DOC(YStart): Vertical start coordinate DOC(YEnd): Vertical end coordinate DOC(Duration): Duration of animation in frames DOC(Curve): Easing curve to use, default is 'linear' DOC(Delay): Delay before animation in frames DOC(Hold): Delay after animation in frames

func (AnimatedPositioned) FrameCount

func (o AnimatedPositioned) FrameCount() int

func (AnimatedPositioned) Paint

func (o AnimatedPositioned) Paint(bounds image.Rectangle, frameIdx int) image.Image

type CubicBezierCurve

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

Bezier curve defined by a, b, c and d.

func (CubicBezierCurve) Transform

func (cb CubicBezierCurve) Transform(t float64) float64

type Curve

type Curve interface {
	Transform(t float64) float64
}

func ParseCurve added in v0.17.1

func ParseCurve(str string) (Curve, error)

type CustomCurve added in v0.17.1

type CustomCurve struct {
	Function *starlark.Function
}

Custom curve implemented as a starlark function

func (CustomCurve) Transform added in v0.17.1

func (cc CustomCurve) Transform(t float64) float64

type LinearCurve

type LinearCurve struct{}

Linear curve moving from 0 to 1 (wait for it...) linearly

func (LinearCurve) Transform

func (lc LinearCurve) Transform(t float64) float64

Jump to

Keyboard shortcuts

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