EffectLine constructor
EffectLine({
- required SpriteTexture texture,
- BlendMode blendMode = BlendMode.dstOver,
- List<
Offset> ? points, - EffectLineWidthMode widthMode = EffectLineWidthMode.linear,
- double minWidth = 10.0,
- double maxWidth = 10.0,
- double widthGrowthSpeed = 0.0,
- EffectLineAnimationMode animationMode = EffectLineAnimationMode.none,
- double scrollSpeed = 0.1,
- double scrollStart = 0.0,
- double? fadeDuration,
- double? fadeAfterDelay,
- double? textureLoopLength,
- bool simplify = true,
- 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;
}