aseprite

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadSprite

func LoadSprite(resource res.Resource) (*sprites.Sprite, error)

func ToSpriteSheet

func ToSpriteSheet(sheet *SpriteSheet, img *ebiten.Image) *sprites.SpriteSheet

Types

type Frame

type Frame struct {
	X int `json:"x"`
	Y int `json:"y"`
	W int `json:"w"`
	H int `json:"h"`
}

type FrameMeta

type FrameMeta struct {
	Frame            Frame            `json:"frame"`
	Rotated          bool             `json:"rotated"`
	Trimmed          bool             `json:"trimmed"`
	SpriteSourceSize SpriteSourceSize `json:"spriteSourceSize"`
	SourceSize       SourceSize       `json:"sourceSize"`
	Duration         int              `json:"duration"`
}

type FrameTags

type FrameTags struct {
	Name      string `json:"name"`
	From      int    `json:"from"`
	To        int    `json:"to"`
	Direction string `json:"direction"`
}

type Frames

type Frames []FrameMeta

type Layers

type Layers struct {
	Name      string `json:"name"`
	Opacity   int    `json:"opacity"`
	BlendMode string `json:"blendMode"`
}

type Meta

type Meta struct {
	App       string      `json:"app"`
	Version   string      `json:"version"`
	Image     string      `json:"image"`
	Format    string      `json:"format"`
	Size      Size        `json:"size"`
	Scale     string      `json:"scale"`
	FrameTags []FrameTags `json:"frameTags"`
	Layers    []Layers    `json:"layers"`
	Slices    []any       `json:"slices"`
}

type Size

type Size struct {
	W int `json:"w"`
	H int `json:"h"`
}

type SourceSize

type SourceSize struct {
	W int `json:"w"`
	H int `json:"h"`
}

type SpriteSheet

type SpriteSheet struct {
	Frames Frames `json:"frames"`
	Meta   Meta   `json:"meta"`
}

func Load

func Load(in io.Reader) (*SpriteSheet, error)

func LoadFile

func LoadFile(filename string) (*SpriteSheet, error)

func LoadResource added in v0.0.2

func LoadResource(resource res.Resource) (*SpriteSheet, error)

type SpriteSourceSize

type SpriteSourceSize struct {
	X int `json:"x"`
	Y int `json:"y"`
	W int `json:"w"`
	H int `json:"h"`
}

Jump to

Keyboard shortcuts

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