Documentation
¶
Index ¶
- Variables
- type Cache
- func (c *Cache) AddSheet(meta, sheet string) *Sheet
- func (c *Cache) AddSheetAsync(meta, sheet string, cb func(*Sheet))
- func (c *Cache) Clear()
- func (c *Cache) Dump()
- func (c *Cache) Exit()
- func (c *Cache) GC()
- func (c *Cache) RemoveSheet(s *Sheet)
- func (c *Cache) RemoveSheetByName(key string)
- func (c *Cache) Sheet(name string) *Sheet
- func (c *Cache) SnapshotSheet() map[string]*Sheet
- func (c *Cache) String() string
- func (c *Cache) SubTex(sheet, tex string) *sprite.SubTex
- type Frames
- type Meta
- type Sheet
- type SheetConfig
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 (*Cache) AddSheetAsync ¶
func (*Cache) RemoveSheet ¶
RemoveAtlas deletes a texture from the cache given a texture
func (*Cache) RemoveSheetByName ¶
RemoveAtlasByName deletes a atlas from the cache given a its key name
func (*Cache) SnapshotSheet ¶
SnapshotTextures get a snapshot.
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.
type SheetConfig ¶
AtlasConfig is the configure read from (json-hash file) which generated by TexturePacker.
Click to show internal directories.
Click to hide internal directories.