🔥 Flame Extensions
Enhanced components and utilities for the Flame game engine, providing advanced features not available in the core library.
✨ Features
- GrayscaleSpriteComponent: High-performance grayscale sprite rendering
🚀 Installation
Add to your pubspec.yaml
:
dependencies:
flame_extensions: ^1.0.0
📖 Usage
Grayscale Sprite Component
import 'package:flame_extensions/flame_extensions.dart';
// Create a grayscale sprite
final sprite = GrayscaleSpriteComponent(
sprite: await Sprite.load('player.png'),
position: Vector2(100, 100),
isGray: true,
);
// Toggle grayscale programmatically
sprite.toggleGrayscale();
From Asset Path
final sprite = await GrayscaleSpriteComponent.fromAsset(
'sprites/player.png',
position: Vector2(100, 100),
size: Vector2(64, 64),
isGray: false,
);
🎮 Example
Check out the example folder for a complete working demo.
##📊 Performance
- Zero load time overhead
- Hardware-accelerated rendering
- Memory efficient (no image duplication)
- Optimized for mobile gaming
📄 License
This project is licensed under the MIT License. See the LICENSE file for details.