sprite_sheet 1.0.0+2 copy "sprite_sheet: ^1.0.0+2" to clipboard
sprite_sheet: ^1.0.0+2 copied to clipboard

Flutter package for working with 2D sprite sheet animations

đŸ•šī¸ 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 #

  1. 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,
);
copied to clipboard
  1. Initialize the controller
final controller = SpriteController<MyAnimationType>({
	MyAnimationType.run: runAnimation,
});
copied to clipboard
  1. Use it in your widget
SpriteSheet(
	controller: controller,
	glow: SpriteGlow.color(
		color: Colors.cyanAccent,
		blurX: 10,
		thicknessX: 10,
	),
)
copied to clipboard

🎮 Demos #

Here are some pixel art demos built using this package:

Try Demo đŸƒâ€â™‚ī¸ 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!

0
likes
160
points
5
downloads

Publisher

unverified uploader

Weekly Downloads

2024.09.09 - 2025.08.04

Flutter package for working with 2D sprite sheet animations

Repository (GitHub)

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on sprite_sheet