Documentation ¶
Index ¶
- Variables
- type CreateFlags
- type PackFlags
- type Packer
- func (pack *Packer) Get(id int) (rect image.Rectangle)
- func (pack *Packer) Image() *image.RGBA
- func (pack *Packer) Insert(id int, pic *image.RGBA)
- func (pack *Packer) InsertFromFile(id int, filename string) (err error)
- func (pack *Packer) Pack() (err error)
- func (pack *Packer) Save(filename string) (err error)
- func (pack *Packer) SetDefaultId(id int)
- func (pack *Packer) SubImage(id int) (img *image.RGBA)
- type PackerCfg
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNoEmptySpace = errors.New("Couldn't find an empty space") ErrSplitFailed = errors.New("Split failed") ErrGrowthFailed = errors.New("A previously added texture failed to be added after packer growth") ErrUnsupportedSaveExt = errors.New("Unsupported save filename extension") ErrNotPacked = errors.New("Packer must be packed") ErrNotFoundNoDefault = errors.New("Id doesn't exist and a default sprite wasn't specified") ErrAlreadyPacked = errors.New("Pack has already been called for this packer") )
Functions ¶
This section is empty.
Types ¶
type CreateFlags ¶
type CreateFlags uint8
type Packer ¶
type Packer struct {
// contains filtered or unexported fields
}
func (*Packer) InsertFromFile ¶ added in v1.1.0
Automatically parse and insert image from file.
func (*Packer) Pack ¶
Pack takes the added textures and packs them into the packer texture, growing the texture if necessary.
func (*Packer) Save ¶
Saves the internal texture as a file on disk, the output type is defined by the filename extension
func (*Packer) SetDefaultId ¶ added in v1.0.0
Sets the default Id for the packer
If an id doesn't exist in the packer when 'Get' is called, the packer will return this sprite instead.
type PackerCfg ¶ added in v1.0.0
type PackerCfg struct {
Flags CreateFlags
}
Click to show internal directories.
Click to hide internal directories.