Documentation ¶
Overview ¶
Package animation provides support for creating animations from sprite sheets. The sprite package uses this package to render animated sprites.
See README.md for more info.
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 represents an animation sequence made up of 1 or more frames
type Animator ¶
type Animator struct {
// contains filtered or unexported fields
}
Animator drives an animation
func NewAnimator ¶
NewAnimator creates a named animator for an animation
func (*Animator) CurrentFrame ¶
CurrentFrame returns the coordinates of the image to show for the current animation state
type Option ¶
type Option func(a *Animation)
Option is the signature of a configuration function for an animation
func Bidi ¶
func Bidi() Option
Bidi is an Option function make the animation run in a cycle the switches direction when it reaches either end
func FrameSlicer ¶
FrameSlicer is an Option function that slices the texture into individual frames for the animation Frames are sequenced left to right top to bottom offsetX, offsetY - starting point for slicing frames frameWidth, frameHeight - size of each frame colCount - number of horizontal frames to extract for this animation rowCount - number of vertical frames to extract for the animation