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 Left(x, width), Top(y, height) } TopCenter Alignment = func(x float64, y float64, width float64, height float64) (float64, float64) { return Center(x, width), Top(y, height) } TopRight Alignment = func(x float64, y float64, width float64, height float64) (float64, float64) { return Right(x, width), Top(y, height) } MiddleLeft Alignment = func(x float64, y float64, width float64, height float64) (float64, float64) { return Left(x, width), Middle(y, height) } MiddleCenter Alignment = func(x float64, y float64, width float64, height float64) (float64, float64) { return Center(x, width), Middle(y, height) } MiddleRight Alignment = func(x float64, y float64, width float64, height float64) (float64, float64) { return Right(x, width), Middle(y, height) } BottomLeft Alignment = func(x float64, y float64, width float64, height float64) (float64, float64) { return Left(x, width), Bottom(y, height) } BottomMiddle Alignment = func(x float64, y float64, width float64, height float64) (float64, float64) { return Middle(x, width), Bottom(y, height) } BottomRight Alignment = func(x float64, y float64, width float64, height float64) (float64, float64) { return Right(x, width), Bottom(y, height) } )
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 Sprite struct { X float64 Y float64 Origin Alignment Scale float64 Speed float64 Angle float64 Visible bool // contains filtered or unexported fields }
func (*Sprite) SetAnimation ¶ added in v0.0.2
type Spritesheet ¶ added in v0.0.1
type Spritesheet 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) }
Spritesheet loads named Animations from a sprite sheet.
type VerticalAlignment ¶
Click to show internal directories.
Click to hide internal directories.