sxtp

package module
v0.0.0-...-59fb3e5 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: MIT Imports: 18 Imported by: 0

README

Spine Extra Texture Packer (SXTP)

Tool for packing atlases of secondary textures based on the orginal atlas layouts exported from Spine. This is mostly useful when you want to also create a atlas for masks or normals alongside your diffuse atlas exported from spine.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PackMasks

func PackMasks(atlasPages []Atlas, format FileFormat, masksPath, outputPath, suffix string, hasAlpha bool, l *log.Logger) error

PackMasks packs a set of secondary textures using the atlas layouts passed in

Types

type Angle

type Angle float64

func (Angle) Degrees

func (a Angle) Degrees() float64

func (Angle) Radians

func (a Angle) Radians() float64

type Atlas

type Atlas struct {
	Name    string      `atlas:"name"`
	Size    image.Point `atlas:"size"`
	Format  string      `atlas:"format"`
	Filter  Filter      `atlas:"filter"`
	Repeat  string      `atlas:"repeat"`
	Pma     bool        `atlas:"pma"`
	Sprites []Sprite    `atlas:"sprites"`
}

func DecodeAtlas

func DecodeAtlas(reader io.Reader) ([]Atlas, error)

DecodeAtlas Parses a spine atlas file line by line from an io.Reader and returns a struct describing the layout

func (*Atlas) String

func (a *Atlas) String() string

type Bounds

type Bounds struct {
	Position image.Point // Position in Image
	Size     image.Point // Packed Size
}

func (*Bounds) String

func (b *Bounds) String() string

type FileFormat

type FileFormat string
const (
	FormatPNG FileFormat = "png"
	FormatJPG FileFormat = "jpg"
)

type Filter

type Filter struct {
	X, Y string
}

func (*Filter) String

func (f *Filter) String() string

type Offsets

type Offsets struct {
	Offset       image.Point // Offset (Left, Bottom)
	OriginalSize image.Point // Original Size
}

func (*Offsets) String

func (o *Offsets) String() string

type Sprite

type Sprite struct {
	Name    string  `atlas:"name"`
	Index   int     `atlas:"index"`
	Bounds  Bounds  `atlas:"bounds"`
	Offsets Offsets `atlas:"offsets"`
	Rotate  Angle   `atlas:"rotate"`
}

func (*Sprite) String

func (a *Sprite) String() string

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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