packer

package
v0.0.0-...-9211bd0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2014 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Pack

func Pack(sprites []Sprite, atlas Atlas) (*image.RGBA, []byte, error)

Pack the sprite slice so that it fits in the dimensions provided by atlas

Types

type Atlas

type Atlas struct {
	DimX, DimY int
	Space      int
}

Atlas hold dimension and spacing for final image

type Sprite

type Sprite struct {
	Name   string      // sprite name without extension
	Offset image.Point // offset in atlas
	Size   size        // image size
	// contains filtered or unexported fields
}

Sprite contains image and placement data for sprites it also has exported fields for data serialisation

func ReadSprites

func ReadSprites(dir string) ([]Sprite, error)

ReadSprites returns all spritees found in the provided directory

Jump to

Keyboard shortcuts

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