Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/matusollah/sparrow
Sparrow v2 texture atlas library for Go
https://github.com/matusollah/sparrow
adobe adobe-animate atlas flixel fnf friday-night-funkin funkin go golang haxeflixel sparrow starling-framework texture-atlas texture-pack xml
Last synced: 5 days ago
JSON representation
Sparrow v2 texture atlas library for Go
- Host: GitHub
- URL: https://github.com/matusollah/sparrow
- Owner: MatusOllah
- License: mit
- Created: 2023-11-13T19:32:52.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-02-02T14:31:31.000Z (11 months ago)
- Last Synced: 2024-04-17T18:07:36.237Z (8 months ago)
- Topics: adobe, adobe-animate, atlas, flixel, fnf, friday-night-funkin, funkin, go, golang, haxeflixel, sparrow, starling-framework, texture-atlas, texture-pack, xml
- Language: Go
- Homepage: https://pkg.go.dev/github.com/MatusOllah/sparrow
- Size: 4.58 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# sparrow
[![Go Reference](https://pkg.go.dev/badge/github.com/MatusOllah/sparrow.svg)](https://pkg.go.dev/github.com/MatusOllah/sparrow)
[![Go Report Card](https://goreportcard.com/badge/github.com/MatusOllah/sparrow)](https://goreportcard.com/report/github.com/MatusOllah/sparrow)**sparrow** is a Sparrow v2 texture atlas (PNG and XML pair, the same format that FNF uses) library for Go.
Handy if you're making a game that uses Sparrow v2 or rewriting FNF in Go (like me).
## Features
* Decoding
* Encoding
* Image / Frame extracting## Basic Usage
```go
package mainimport (
"image/png"
"github.com/MatusOllah/sparrow"
)func main() {
// Here you can use any png & atlas, I'm using the awesome BOYFRIEND.xml
img, err := png.Decode("BOYFRIEND.png")
if err != nil {
panic(err)
}atlas, err := sparrow.ParseTextureAtlas("BOYFRIEND.xml")
if err != nil {
panic(err)
}// This gets / extracts the BF HEY!!0025 frame
bfHey := atlas.MustGetSubTexture("BF HEY!!0025")
bfHeyImg := bfHey.MustImage(img)// This returns all frames as a map
frames := atlas.EnumerateSubTextures()
}
```## License
MIT License
FNF Boyfriend spritesheet - Apache License