Skip to content
/ pckr Public

on-the-fly sprite packing library for Ebiten

License

Notifications You must be signed in to change notification settings

yohamta/pckr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pckr

Texture Packing library for Ebiten. Packs multiple textures into a single image on-the-fly.

GoDoc

Simple Example

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

image

source code

About

on-the-fly sprite packing library for Ebiten

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages