mirror of
https://github.com/flame-engine/flame.git
synced 2025-11-01 10:38:17 +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
34 lines
620 B
Dart
34 lines
620 B
Dart
import 'dart:ui';
|
|
|
|
import 'package:flutter/foundation.dart';
|
|
|
|
import '../particle.dart';
|
|
import '../position.dart';
|
|
import '../components/component.dart';
|
|
|
|
class ComponentParticle extends Particle {
|
|
final Component component;
|
|
final Position size;
|
|
final Paint overridePaint;
|
|
|
|
ComponentParticle({
|
|
@required this.component,
|
|
this.size,
|
|
this.overridePaint,
|
|
double lifespan,
|
|
}) : super(
|
|
lifespan: lifespan,
|
|
);
|
|
|
|
@override
|
|
void render(Canvas canvas) {
|
|
component.render(canvas);
|
|
}
|
|
|
|
@override
|
|
void update(double dt) {
|
|
super.update(dt);
|
|
component.update(dt);
|
|
}
|
|
}
|