sprites

package
v0.0.0-...-8c1622e Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2016 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PackedSheet

type PackedSheet struct {
	*Sheet
	Width  int
	Height int
	// contains filtered or unexported fields
}

func NewPackedSheet

func NewPackedSheet(w, h int) (i *PackedSheet)

func (*PackedSheet) Copy

func (s *PackedSheet) Copy(key string, src *PackedSheet) (err error)

func (*PackedSheet) Image

func (s *PackedSheet) Image() image.Image

func (*PackedSheet) Pack

func (s *PackedSheet) Pack(key string, img image.Image) (err error)

type Sheet

type Sheet struct {
	Count int
	// contains filtered or unexported fields
}

func NewSheet

func NewSheet() *Sheet

func (*Sheet) AddSprite

func (s *Sheet) AddSprite(key string, bounds, offset mgl32.Vec2) (out *Sprite)

func (*Sheet) Bind

func (s *Sheet) Bind()

func (*Sheet) BufferID

func (s *Sheet) BufferID() uint32

func (*Sheet) Delete

func (s *Sheet) Delete()

func (*Sheet) Exists

func (s *Sheet) Exists(key string) (exists bool)

func (*Sheet) SetTexture

func (s *Sheet) SetTexture(texture *core.Texture)

func (*Sheet) Size

func (s *Sheet) Size() int

func (*Sheet) Sprite

func (s *Sheet) Sprite(key string) (out *Sprite, err error)

func (*Sheet) Texture

func (s *Sheet) Texture() *core.Texture

func (*Sheet) Unbind

func (s *Sheet) Unbind()

type Sprite

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

func (*Sprite) ImageBounds

func (s *Sprite) ImageBounds() image.Rectangle

func (*Sprite) Index

func (s *Sprite) Index() int

func (*Sprite) WorldDimensions

func (s *Sprite) WorldDimensions(pxPerUnit float32) mgl32.Vec2

type SpriteInstanceList

type SpriteInstanceList struct {
	*render.InstanceList
	// contains filtered or unexported fields
}

func NewSpriteInstanceList

func NewSpriteInstanceList(sheet *Sheet, pixelsPerUnit float32) *SpriteInstanceList

func (*SpriteInstanceList) SetFrame

func (l *SpriteInstanceList) SetFrame(instance *render.Instance, frame string) (err error)

type SpriteInstances

type SpriteInstances interface {
	render.Instances
	SetFrame(instance *render.Instance, frame string) (err error)
}

Jump to

Keyboard shortcuts

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