đšī¸ SpriteSheet â Pixel-perfect sprite animation toolkit for Flutter
SpriteSheet is a powerful and flexible toolkit for managing sprite-based animations in Flutter. Designed for pixel art, and interactive experiences and simple games. It helps you render animations from sprite sheets with full control over playback, frame progression, hot swapping and more.
⨠Features
- đī¸ Frame-by-frame animation from sprite sheets
- đ Multiple playback modes: forward, reverse, ping-pong, reverse-ping-pong
- âąī¸ Customizable frame duration and looping
- đ Optional glow effects with static or dynamic color support
- đ¨ Flip sprites along X and Y axes
- đ§ Controller API for play/pause/stop and runtime updates
- â Fully documented and easy to integrate
đ ī¸ Usage
- Define your animation
final runAnimation = AnimationSheet(
image: await loadImage('assets/character_run.png'),
columns: 6,
rows: 1,
frameDuration: Duration(milliseconds: 80),
isLooping: true,
direction: AnimationDirection.forward,
);
- Initialize the controller
final controller = SpriteController<MyAnimationType>({
MyAnimationType.run: runAnimation,
});
- Use it in your widget
SpriteSheet(
controller: controller,
glow: SpriteGlow.color(
color: Colors.cyanAccent,
blurX: 10,
thicknessX: 10,
),
)
đŽ Demos
Here are some pixel art demos built using this package:
| đââī¸ Flip Animations | đī¸ Animation Queuing | đ Dynamic Glow |
|---|
It's scrollable btw
Check out the example folder to see the code of the demo.
đ Classes Overview
| Class | Description |
|---|---|
SpriteController<T> |
Controls sprite playback, direction, frame updates, and flip states |
SpriteSheet |
Widget for rendering sprites using a controller and animation sheet |
AnimationSheet |
Describes a sprite sheet's layout, timing, and playback configuration |
SpriteGlow |
Adds a glow around the sprite, either static or frame-dependent |
GlowColorDelegate |
Base class for customizing glow color logic |
đ§ Why use SpriteSheet?
- Clean API for animation control
- Simple and sufficient logic for sprite animation
- Ideal for pixel-art projects and simple game mechanics
- Built for extensibility and customization
- Production-ready and lightweight
đ License
MIT License. Use freely in personal and commercial projects.
đ¨âđģ Contributions
Got ideas? Found a bug? PRs and issues are welcome!
Libraries
- sprite_sheet
- Exports core modules for sprite sheet functionality, including: