sprite

package
v0.0.0-...-7fee067 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(spriteString string) (pixels []uint8)

func DrawPixels

func DrawPixels(d displayer, pixels []uint8, x float64, y float64)

func Encode

func Encode(spriteNums []uint8) string

func EncodeCStruct

func EncodeCStruct(spriteNums []uint8) string

func Parse

func Parse(spriteString string) (pixels []uint8)

func Unmarshal

func Unmarshal(b []byte, s *Sprite)

Types

type Sprite

type Sprite struct {
	Animations [][][]uint8
	Width      int
}

func New

func New() Sprite

func (Sprite) Draw

func (s Sprite) Draw(d displayer, animationIndex int, x float64, y float64)

func (Sprite) DrawPixels

func (s Sprite) DrawPixels(d displayer, pixels []uint8, x float64, y float64)

func (Sprite) GetPixels

func (s Sprite) GetPixels(animationIndex int, frameIndex int) []uint8

func (Sprite) VerticalMirror

func (s Sprite) VerticalMirror(animationIndex int, frameIndex int) []uint8

Jump to

Keyboard shortcuts

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