Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Left HorizonalAlignment = func(x float64, width float64) float64 { return x } Center HorizonalAlignment = func(x float64, width float64) float64 { return x - (width / 2) } Right HorizonalAlignment = func(x float64, width float64) float64 { return x - width } Top VerticalAlignment = func(y float64, height float64) float64 { return y } Middle VerticalAlignment = func(y float64, height float64) float64 { return y - (height / 2) } Bottom VerticalAlignment = func(y float64, height float64) float64 { return y - height } TopLeft Alignment = func(x float64, y float64, width float64, height float64) (float64, float64) { return Top(y, height), Left(x, width) } TopCenter Alignment = func(x float64, y float64, width float64, height float64) (float64, float64) { return Top(y, height), Center(x, width) } TopRight Alignment = func(x float64, y float64, width float64, height float64) (float64, float64) { return Top(y, height), Right(x, width) } MiddleLeft Alignment = func(x float64, y float64, width float64, height float64) (float64, float64) { return Middle(y, height), Left(x, width) } MiddleCenter Alignment = func(x float64, y float64, width float64, height float64) (float64, float64) { return Middle(y, height), Center(x, width) } MiddleRight Alignment = func(x float64, y float64, width float64, height float64) (float64, float64) { return Middle(y, height), Right(x, width) } BottomLeft Alignment = func(x float64, y float64, width float64, height float64) (float64, float64) { return Bottom(y, height), Left(x, width) } BottomMiddle Alignment = func(x float64, y float64, width float64, height float64) (float64, float64) { return Bottom(y, height), Middle(x, width) } BottomRight Alignment = func(x float64, y float64, width float64, height float64) (float64, float64) { return Bottom(y, height), Right(x, width) } )
Functions ¶
This section is empty.
Types ¶
type Animation ¶
type Animation struct { // Frames is a slice of this animation's individual frames. Frames []*Frame // Direction is the direction the animation will be played (forward/reverse). Direction Direction }
Animation objects contain the actual images and metadata used by sprites. Sprites are responsible for maintaining their own state, such as which frame of an animation is currently displayed.
type Frame ¶
type Frame struct { // Image is the frame's image. Image *ebiten.Image // Duration is the duration the frame is displayed before progressing to the next frame. Duration time.Duration }
Frame represents a single animation frame.
type HorizonalAlignment ¶
type Sprite ¶
type SpriteSheetLoader ¶
type SpriteSheetLoader interface { // Animation returns the tagged animation with the specified name. Animation(name string) (*Animation, error) // AllAnimations returns a mapping of all tagged animations and their names. AllAnimations() (map[string]*Animation, error) }
SpriteSheetLoader loads named Animations from a sprite sheet.
type VerticalAlignment ¶
Click to show internal directories.
Click to hide internal directories.