Documentation ¶
Overview ¶
Package animate provides animation for GUIs built using the package goey.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddAnimation ¶
func AddAnimation(elem Element)
AddAnimation adds the element to the set of elements with active animations. As necessary, this function will arrange for the element to be updated with the time of the current animation frame so that its state can be updated.
This function should only be called from the GUI thread.
Types ¶
type EaseLength ¶
type EaseLength struct {
// contains filtered or unexported fields
}
EaseLength encapsulates the calculations needs to smoothly vary a length.
func NewEaseLength ¶
func NewEaseLength(newValue, oldValue base.Length) EaseLength
NewEaseLength creates a new ease to transition a length from the old value to the new value. The transition time will be the same as the constant DefaultTransitionTime.
func (*EaseLength) Done ¶
func (e *EaseLength) Done(t Time) bool
Done returns true if the animation is completed at the specified time.
type Element ¶
type Element interface { // AnimateFrame will be called for each frame to provide the element the // opportunity to modify its state. The method should return true to // continue to receive callbacks. Once the element's animations are // completed, it should return false. AnimateFrame(time Time) bool }
An element that wishes to be animated must implement this interface.
type Time ¶
type Time uint
Time represents an instant in time with millisecond precision.
const ( // The default transition time is the default time for an animation. DefaultTransitionTime Time = defaultTransitionTime )
func CurrentTime ¶
func CurrentTime() Time
CurrentTime returns the time for the current animation frame. If no animations are currently running, it will return the current local time.