EffectLine constructor

EffectLine({
  1. required SpriteTexture texture,
  2. BlendMode blendMode = BlendMode.dstOver,
  3. List<Offset>? points,
  4. EffectLineWidthMode widthMode = EffectLineWidthMode.linear,
  5. double minWidth = 10.0,
  6. double maxWidth = 10.0,
  7. double widthGrowthSpeed = 0.0,
  8. EffectLineAnimationMode animationMode = EffectLineAnimationMode.none,
  9. double scrollSpeed = 0.1,
  10. double scrollStart = 0.0,
  11. double? fadeDuration,
  12. double? fadeAfterDelay,
  13. double? textureLoopLength,
  14. bool simplify = true,
  15. ColorSequence? colorSequence,
})

Creates a new EffectLine with the specified parameters. Only the texture parameter is required, all other parameters are optional.

Implementation

EffectLine({
  required this.texture,
  this.blendMode = BlendMode.dstOver,
  List<Offset>? points,
  this.widthMode = EffectLineWidthMode.linear,
  this.minWidth = 10.0,
  this.maxWidth = 10.0,
  this.widthGrowthSpeed = 0.0,
  this.animationMode = EffectLineAnimationMode.none,
  this.scrollSpeed = 0.1,
  double scrollStart = 0.0,
  this.fadeDuration,
  this.fadeAfterDelay,
  this.textureLoopLength,
  this.simplify = true,
  ColorSequence? colorSequence,
}) {
  this.points = points ?? [];

  _colorSequence = colorSequence;
  _colorSequence ??= ColorSequence.fromStartAndEndColor(
    start: const Color(0xffffffff),
    end: const Color(0xffffffff),
  );

  _offset = scrollStart;

  _painter = TexturedLinePainter(this.points, [], [], texture, null);
  _painter.textureLoopLength = textureLoopLength;
}