aseprite

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: May 22, 2020 License: BSD-2-Clause, MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AnimDirection

type AnimDirection string
const (
	AnimForward  AnimDirection = "forward"
	AnimReverse  AnimDirection = "reverse"
	AnimPingPong AnimDirection = "pingpong"
)

type AnimEventIO

type AnimEventIO struct {
	Frame      int    `json:"frame,omitempty"`
	EventName  string `json:"event_name"`
	EventValue string `json:"event_value"`
}

type AnimationIO

type AnimationIO struct {
	Tagname    string        `json:"tagname"`
	OutputName string        `json:"output_name"`
	ClipMode   string        `json:"clip_mode,omitempty"`
	Events     []AnimEventIO `json:"events"`
	EndedEvent *AnimEventIO  `json:"ended_event,omitempty"`
}

type AtlasImporter

type AtlasImporter struct {
	Sprites      []FrameIO `json:"sprites"`
	SpriteSheets []string  `json:"sprite_sheets"`
	Output       string    `json:"output,omitempty"`
	ImageFilter  string    `json:"image_filter,omitempty"`
}

func (AtlasImporter) SpriteWithFilename

func (i AtlasImporter) SpriteWithFilename(filename string) (frame FrameIO, exists bool)

type File

type File interface {
	Walk(fn func(i FrameInfo) bool)
	Type() FileType
	GetMetadata() Metadata
	GetFrame(name string) (i FrameInfo, ok bool)
}

func Parse

func Parse(jsonb []byte) (File, error)

type FileMap

type FileMap struct {
	Frames map[string]FrameInfo `json:"frames"`
	Meta   Metadata             `json:"meta"`
}

func ParseMap

func ParseMap(jsonb []byte) (*FileMap, error)

func (*FileMap) GetFrame

func (f *FileMap) GetFrame(name string) (i FrameInfo, ok bool)

func (*FileMap) GetMetadata

func (f *FileMap) GetMetadata() Metadata

func (*FileMap) Type

func (f *FileMap) Type() FileType

func (*FileMap) Walk

func (f *FileMap) Walk(fn func(i FrameInfo) bool)

type FileSlice

type FileSlice struct {
	Frames []FrameInfo `json:"frames"`
	Meta   Metadata    `json:"meta"`
}

func ParseSlice

func ParseSlice(jsonb []byte) (*FileSlice, error)

func (*FileSlice) GetFrame

func (f *FileSlice) GetFrame(name string) (i FrameInfo, ok bool)

func (*FileSlice) GetMetadata

func (f *FileSlice) GetMetadata() Metadata

func (*FileSlice) Type

func (f *FileSlice) Type() FileType

func (*FileSlice) Walk

func (f *FileSlice) Walk(fn func(i FrameInfo) bool)

type FileType

type FileType string
const (
	FileTypeSlice FileType = "slice"
	FileTypeMap   FileType = "map"
)

type FrameIO

type FrameIO struct {
	Filename   string `json:"filename"`
	OutputName string `json:"output_name"`
	SheetIndex int    `json:"sheet_index"`
	SheetName  string `json:"sheet_name,omitempty"`
}

type FrameInfo

type FrameInfo struct {
	Filename         string    `json:"filename"`
	Frame            FrameRect `json:"frame"`
	Rotated          bool      `json:"rotated"`
	Trimmed          bool      `json:"trimmed"`
	SpriteSourceSize FrameRect `json:"spriteSourceSize"`
	SourceSize       ImSize    `json:"sourceSize"`
	Duration         int       `json:"duration"`
}

type FrameRect

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

func (FrameRect) String

func (r FrameRect) String() string

func (FrameRect) ToRect

func (r FrameRect) ToRect() image.Rectangle

type FrameTag

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

"name": "lbar1", "from": 0, "to": 11, "direction": "forward"

type ImSize

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

type Layer

type Layer struct {
	Name      string  `json:"name"`
	Opacity   float64 `json:"opacity"`
	BlendMode string  `json:"blendMode"`
}

type Metadata

type Metadata struct {
	App       string      `json:"app"`
	Version   string      `json:"version"`
	Image     string      `json:"image"`
	Format    string      `json:"format"`
	Size      ImSize      `json:"size,omitempty"`
	Scale     string      `json:"scale"`
	FrameTags []FrameTag  `json:"frameTags"`
	Layers    []Layer     `json:"layers,omitempty"`
	Slices    interface{} `json:"slices"`
}

type Slice

type Slice struct {
	Name  string          `json:"name"`
	Color string          `json:"color"`
	Keys  []SliceKeyframe `json:"keys"`
}

type SliceKeyframe

type SliceKeyframe struct {
	Frame  int       `json:"frame"`
	Bounds FrameRect `json:"bounds"`
	Pivot  Vec2      `json:"pivot"`
}

type Vec2

type Vec2 struct {
	X int `json:"x"`
	Y int `json:"y"`
}

Jump to

Keyboard shortcuts

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