mirror of
https://github.com/flame-engine/flame.git
synced 2025-11-01 09:39:12 +08:00
fix: doc/example/particles/readme, attempt to embed webm preview fix: doc/example/particles better sample for chaining refactor: Particle, dropped duration support
27 lines
527 B
Dart
27 lines
527 B
Dart
import 'dart:ui';
|
|
|
|
import 'package:flutter/foundation.dart';
|
|
|
|
import '../particle.dart';
|
|
|
|
/// Plain circle with no other behaviors
|
|
/// Consider composing with other [Particle]
|
|
/// to achieve needed effects
|
|
class CircleParticle extends Particle {
|
|
final Paint paint;
|
|
final double radius;
|
|
|
|
CircleParticle({
|
|
@required this.paint,
|
|
this.radius = 10.0,
|
|
double lifespan,
|
|
}) : super(
|
|
lifespan: lifespan,
|
|
);
|
|
|
|
@override
|
|
void render(Canvas c) {
|
|
c.drawCircle(Offset.zero, radius, paint);
|
|
}
|
|
}
|