sheet

package
v0.0.0-...-cddbbad Latest Latest
Warning

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

Go to latest
Published: May 7, 2015 License: GPL-3.0 Imports: 12 Imported by: 0

README

The tool for create a base project from the template.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	//ErrNonSupported standard for a file format which can't supported now.
	ErrNonSupported = errors.New("not supported format")

	//ErrIllegalParam standard for illegal parameter(s)
	ErrIllegalParam = errors.New("illegal parameter(s)")
)

Functions

This section is empty.

Types

type Cache

type Cache struct {
	// contains filtered or unexported fields
}

func NewCache

func NewCache(eng sprite.Engine) *Cache

func (*Cache) AddSheet

func (c *Cache) AddSheet(meta, sheet string) *Sheet

func (*Cache) AddSheetAsync

func (c *Cache) AddSheetAsync(meta, sheet string, cb func(*Sheet))

func (*Cache) Clear

func (c *Cache) Clear()

func (*Cache) Dump

func (c *Cache) Dump()

func (*Cache) Exit

func (c *Cache) Exit()

Exit exit the cache.

func (*Cache) GC

func (c *Cache) GC()

func (*Cache) RemoveSheet

func (c *Cache) RemoveSheet(s *Sheet)

RemoveAtlas deletes a texture from the cache given a texture

func (*Cache) RemoveSheetByName

func (c *Cache) RemoveSheetByName(key string)

RemoveAtlasByName deletes a atlas from the cache given a its key name

func (*Cache) Sheet

func (c *Cache) Sheet(name string) *Sheet

func (*Cache) SnapshotSheet

func (c *Cache) SnapshotSheet() map[string]*Sheet

SnapshotTextures get a snapshot.

func (*Cache) String

func (c *Cache) String() string

func (*Cache) SubTex

func (c *Cache) SubTex(sheet, tex string) *sprite.SubTex

type Frames

type Frames map[string]struct {
	Frame struct {
		X int `json:"x"`
		Y int `json:"y"`
		W int `json:"w"`
		H int `json:"h"`
	}
	Size struct {
		W int `json:"w"`
		H int `json:"h"`
	} `json:"sourceSize"`
}

Frames standard for sub texture's meta info in a atlas.

type Meta

type Meta struct {
	Version string `json:"version"`
	Image   string `json:"image"`
	Format  string `json:"format"`
	Size    struct {
		W int `json:"w"`
		H int `json:"h"`
	} `json:"size"`
	Scale string `json:"scale"`
}

Meta standard for atlas's meta info.

type Sheet

type Sheet struct {
	// contains filtered or unexported fields
}

Atlas implements a texture atlas.

func (*Sheet) SubTex

func (a *Sheet) SubTex(name string) *sprite.SubTex

SubTex get the sub texture with the specific name.

type SheetConfig

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

AtlasConfig is the configure read from (json-hash file) which generated by TexturePacker.

Jump to

Keyboard shortcuts

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