Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Animation ¶ added in v0.2.0
type Animation struct {
// contains filtered or unexported fields
}
Animation is a series of sprites that change after a certain number of frames in sequential order
func MakeAnimation ¶ added in v0.4.0
MakeAnimation builds an animation from the given sprite sprites and frame lengths.
func MakeAnimationFromSheet ¶ added in v0.4.0
func MakeAnimationFromSheet(ss SpriteSheet, ids []string, frameLength int) (*Animation, error)
MakeAnimationFromSheet builds an animation using sprites pulled from the given spritesheet using the given ids and frame lengths.
type SpriteSheet ¶
type SpriteSheet struct { Cache map[string]*pixel.Sprite Alias map[string]int Packr *packer.Packer }
SpriteSheet
func NewSpriteSheet ¶ added in v0.2.0
func NewSpriteSheet(debugDraw bool) *SpriteSheet
NewSpriteSheet creates a new instatiated sprite sheet
func (*SpriteSheet) AddSprite ¶ added in v0.2.0
func (ss *SpriteSheet) AddSprite(pic pixel.Picture, id string) error
func (*SpriteSheet) GetSprite ¶
func (ss *SpriteSheet) GetSprite(id string) *pixel.Sprite
GetSprite will return the sprite in the Cache (or create&add it to the Cache) from the given int id
func (*SpriteSheet) Optimize ¶ added in v0.5.0
func (ss *SpriteSheet) Optimize()
Optimize the underlying texture
func (SpriteSheet) SourcePic ¶
func (ss SpriteSheet) SourcePic() pixel.Picture
SourcePic returns the underlying pixel.Picture of the spritesheet (for sure with Batch rendering)
Click to show internal directories.
Click to hide internal directories.