graphics

package
v0.0.0-...-9aa04a4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 14, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Canvas

type Canvas interface {
	DrawSprite(sprite *pixel.Sprite, pos pixel.Matrix)
	DrawRect(*physics.Rect)
	DrawVertex(pixel.Vec, pixel.RGBA)
	Center() pixel.Vec
}

type SpriteAnimation

type SpriteAnimation struct {
	// contains filtered or unexported fields
}

func NewSpriteAnimation

func NewSpriteAnimation(sprites []*pixel.Sprite) *SpriteAnimation

func (*SpriteAnimation) NextFrame

func (s *SpriteAnimation) NextFrame() SpriteAnimationFrame

func (*SpriteAnimation) OnDone

func (s *SpriteAnimation) OnDone(subscriber func())

type SpriteAnimationFrame

type SpriteAnimationFrame struct {
	Sprite *pixel.Sprite
}

type Spritesheet

type Spritesheet struct {
	// contains filtered or unexported fields
}

func LoadSpritesheet

func LoadSpritesheet(ctx context.Context, cfg *config.Spritesheet) (*Spritesheet, error)

func (Spritesheet) Index

func (s Spritesheet) Index(x, y int) (*pixel.Sprite, error)

func (Spritesheet) Range

func (s Spritesheet) Range(configs []*config.SpriteFrame) ([]*pixel.Sprite, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL