animation

package
Version: v0.0.0-...-0cd4edb Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2018 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package animation adds the Animation updater system with the clip and keyframe components

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Clip

type Clip struct {
	engine.Component
	// contains filtered or unexported fields
}

Clip is the sequence of all the frames of a animation. It also controls the state, direction, repetition, and speed of the animation.

func NewClip

func NewClip(s float64, f float64, v std.Animatable) *Clip

NewClip creates and sets a new orphan clip

func (*Clip) AddKeyFrame

func (a *Clip) AddKeyFrame(i float64, d float64, t std.Animatable)

AddKeyFrame appends an animation frame to the clip.

func (*Clip) Loop

func (a *Clip) Loop()

Loop set the clip to loop

func (*Clip) Pause

func (a *Clip) Pause()

Pause the clip

func (*Clip) Set

func (a *Clip) Set(s float64, f float64, o std.Animatable)

Set used to define all the require properties of a Clip

func (*Clip) SetAutoplay

func (a *Clip) SetAutoplay(ap bool)

SetAutoplay set the autoplay property of the clip

func (*Clip) Start

func (a *Clip) Start()

Start or resume the clip

func (*Clip) Stop

func (a *Clip) Stop()

Stop and reset the clip

func (*Clip) Update

func (a *Clip) Update()

Update is called on every tick of the game loop if running is set to true

type KeyFrame

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

KeyFrame holds the duration that a animation frame as well as the targeted value it is animating towards

func (*KeyFrame) Duration

func (a *KeyFrame) Duration() float64

Duration returns frame duration

func (*KeyFrame) FrameIndex

func (a *KeyFrame) FrameIndex() float64

FrameIndex returns current frame index

func (*KeyFrame) SetStep

func (a *KeyFrame) SetStep(s std.Animatable)

SetStep set/overwrites the current stop of the keyframe

func (*KeyFrame) Step

func (a *KeyFrame) Step(value std.Animatable)

Step steps forward towards the target

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL