spr

package
v0.0.0-...-3eebe10 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2024 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HeaderSignature = "SP"
	PaletteSize     = 1024

	FileTypePAL  FileType = 0
	FileTypeRGBA FileType = 1
)

Variables

This section is empty.

Functions

This section is empty.

Types

type FileType

type FileType uint32

type SpriteFile

type SpriteFile struct {
	Header struct {
		Signature          string
		Version            float32
		PalettedFrameCount uint16
		RGBAFrameCount     uint16
		RGBAIndex          uint16
	}

	Frames  []*SpriteFrame
	Palette [PaletteSize]byte
	Images  []*graphic.UniqueRGBA
}

func Load

func Load(data []byte) (f *SpriteFile, err error)

func (*SpriteFile) ImageAt

func (f *SpriteFile) ImageAt(index character.SpriteIndex) *graphic.UniqueRGBA

type SpriteFrame

type SpriteFrame struct {
	SpriteType FileType
	Width      uint16
	Height     uint16
	Data       []byte
	Compiled   bool
}

Jump to

Keyboard shortcuts

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