Versions in this module Expand all Collapse all v1 v1.1.0 Nov 14, 2023 Changes in this version + var ErrSubTextureDoesNotExist error = errors.New("sub-texture does not exist") type TextureAtlas + func ParseTextureAtlasFromFS(fsys fs.FS, path string) (*TextureAtlas, error) + func (ta *TextureAtlas) EnumerateSubTextures() map[string]*SubTexture + func (ta *TextureAtlas) GetSubTexture(name string) (*SubTexture, error) + func (ta *TextureAtlas) MustGetSubTexture(name string) *SubTexture v1.0.0 Nov 13, 2023 Changes in this version + var ErrCroppingUnsupported error = errors.New("image does not support cropping") + type SubTexture struct + FrameHeight int + FrameWidth int + FrameX int + FrameY int + Height int + Name string + Width int + X int + Y int + func NewSubTexture(name string, x, y, width, height int) *SubTexture + func NewSubTextureFromRect(name string, r image.Rectangle) *SubTexture + func (st *SubTexture) Image(i image.Image) (image.Image, error) + func (st *SubTexture) MustImage(i image.Image) image.Image + func (st *SubTexture) Rect() image.Rectangle + type TextureAtlas struct + ImagePath string + SubTextures []*SubTexture + func NewTextureAtlas() *TextureAtlas + func ParseTextureAtlas(xmlData []byte) (*TextureAtlas, error) + func (ta *TextureAtlas) Encode() ([]byte, error)