https://github.com/setanarut/aseplayer
Aseprite animation player for Ebitengine
https://github.com/setanarut/aseplayer
2d-graphics ase aseprite decoder ebiten ebitengine go golang parser player sprite-animation
Last synced: about 2 months ago
JSON representation
Aseprite animation player for Ebitengine
- Host: GitHub
- URL: https://github.com/setanarut/aseplayer
- Owner: setanarut
- License: mit
- Created: 2026-01-07T20:30:34.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2026-01-12T08:31:17.000Z (3 months ago)
- Last Synced: 2026-01-13T21:25:25.799Z (3 months ago)
- Topics: 2d-graphics, ase, aseprite, decoder, ebiten, ebitengine, go, golang, parser, player, sprite-animation
- Language: Go
- Homepage: https://pkg.go.dev/github.com/setanarut/aseplayer
- Size: 22.5 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# aseplayer
Aseprite animation player for Ebitengine.
1. Layers are flattened, blending modes are applied, and frames are arranged on a single texture atlas. Invisible and reference layers are ignored.
2. Each [Tag](https://www.aseprite.org/docs/tags) is imported as an `Animation{}` struct and is ready to play.
-
3. AsePlayer supports three Animation Directions: `Forward`, `Ping-pong`, and `Reverse`.
-
4. [Frame durations](https://www.aseprite.org/docs/frame-duration) are supported. The animation plays according to these durations.
5. One-time playback is not currently supported. Animations will always play in an infinite loop.
---
There are two methods available to read the file.
```Go
func NewAnimPlayerFromAsepriteFileSystem(fs fs.FS, asePath string) *AnimPlayer
func NewAnimPlayerFromAsepriteFile(asePath string) *AnimPlayer
```
## Usage
A pseudo-code
```Go
func (g *Game) Update() error {
if inpututil.IsKeyJustPressed(ebiten.KeyRight) {
g.myAnimPlayer.SetAnim("walk")
}
if inpututil.IsKeyJustPressed(ebiten.KeySpace) {
g.myAnimPlayer.SetAnim("jump")
}
g.myAnimPlayer.Update()
return nil
}
func (g *Game) Draw(s *ebiten.Image) {
s.DrawImage(g.myAnimPlayer.CurrentFrame, nil)
}
```