https://github.com/yottahmd/pckr
on-the-fly sprite packing library for Ebiten
https://github.com/yottahmd/pckr
ebiten ebiten-game-library texture-packer
Last synced: 7 months ago
JSON representation
on-the-fly sprite packing library for Ebiten
- Host: GitHub
- URL: https://github.com/yottahmd/pckr
- Owner: yottahmd
- License: mit
- Created: 2021-10-15T10:33:59.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2021-11-05T10:15:14.000Z (almost 4 years ago)
- Last Synced: 2025-03-07T12:33:48.877Z (7 months ago)
- Topics: ebiten, ebiten-game-library, texture-packer
- Language: Go
- Homepage:
- Size: 46.9 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pckr
Texture Packing library for [Ebiten](https://ebiten.org/). Packs multiple textures into a single image on-the-fly.
[GoDoc](https://pkg.go.dev/github.com/yohamta/pckr)
## Simple Example
```go
func (g *Game) setup() {// create a new packer
packer := pckr.NewPacker(1024, 1024)// add images to the packer
packer.Add("priest", ebiten.NewImageFromImage(bytes2Image(&images.CHARACTER_HERO_PRIEST)), 0, 0, 600, 300)
packer.Add("archor", ebiten.NewImageFromImage(bytes2Image(&images.CHARACTER_HERO_ARCHOR)), 0, 0, 600, 300)
packer.Add("warrior", ebiten.NewImageFromImage(bytes2Image(&images.CHARACTER_HERO_WARRIOR)), 0, 0, 600, 300)// execute texture packing
packer.Pack()packedImage := packer.Image()
packedLocation := packer.Location("archor")// ...
}
```## Result
[source code](https://github.com/yohamta/pckr/blob/master/examples/packing/main.go)