EffectLine class
The EffectLine class is using the TexturedLine class to draw animated lines. These can be used to draw things such as smoke trails, electricity effects, or other animated types of lines.
Constructors
-
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.
Properties
- animationMode → EffectLineAnimationMode
-
The mode used to animate the texture of the line.
final
- blendMode → BlendMode
-
The transfer mode used to draw the line, default is
TransferMode.dstOver
.final -
children
→ List<
Node> -
A list of the children of this node.
no setterinherited
- colorSequence → ColorSequence
-
Color gradient used to draw the line, from start to finish.
no setter
-
constraints
↔ List<
Constraint> ? -
A List of
Constraint
s that will be applied to the node. The constraints are applied after the update method has been called.getter/setter pairinherited - fadeAfterDelay → double?
-
The time it takes until an added point starts to fade out.
final
- fadeDuration → double?
-
The time it takes for an added point to fade out. It's total life time is
fadeDuration + fadeAfterDelay.
final
- handleMultiplePointers ↔ bool
-
If set to true the node will receive multiple pointers, otherwise it will
only receive events the first pointer.
getter/setter pairinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- inverseTransformMatrix → Matrix4
-
The inverse transform matrix used by this node.
no setterinherited
- maxWidth → double
-
The width of the line at its thickest point.
final
- minWidth → double
-
The width of the line at its thinnest point.
final
- motions → MotionController
-
The MotionController associated with this node.
no setterinherited
- parent → Node?
-
The parent of this node, or null if it doesn't have a parent.
no setterinherited
- paused ↔ bool
-
Decides if the node and its children is currently paused.
getter/setter pairinherited
-
points
↔ List<
Offset> -
List of points that make up the line. Typically, you will only want to
set this at the beginning. Then use addPoint to add additional points
to the line.
getter/setter pair
- position ↔ Offset
-
The position of this node relative to its parent.
getter/setter pairinherited
- rotation ↔ double
-
The rotation of this node in degrees.
getter/setter pairinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scale ↔ double
-
The scale of this node relative its parent.
getter/setter pairinherited
- scaleX ↔ double
-
The horizontal scale of this node relative its parent.
getter/setter pairinherited
- scaleY ↔ double
-
The vertical scale of this node relative its parent.
getter/setter pairinherited
- scrollSpeed → double
-
The speed of which the texture of the line is scrolling. This property
is only used if the animationMode is set to
EffectLineAnimationMode.scroll.
final
- simplify → bool
-
True if the line should be simplified by removing points that are close
to other points. This makes drawing faster, but can result in a slight
jittering effect when points are added.
final
- skewX ↔ double
-
The skew along the x-axis of this node in degrees.
getter/setter pairinherited
- skewY ↔ double
-
The skew along the y-axis of this node in degrees.
getter/setter pairinherited
- spriteBox → SpriteBox?
-
The SpriteBox this node is added to, or null if it's not currently
added to a SpriteBox.
no setterinherited
- texture → SpriteTexture
-
The texture used to draw the line.
final
- textureLoopLength → double?
-
The length, in points, that the texture is stretched to. If the
textureLoopLength is shorter than the line, the texture will be looped.
final
- transformMatrix → Matrix4
-
The transformMatrix describes the transformation from the node's parent.
no setterinherited
- userInteractionEnabled ↔ bool
-
The node will receive user interactions, such as pointer (touch or mouse)
events.
getter/setter pairinherited
- visible ↔ bool
-
The visibility of this node and its children.
getter/setter pairinherited
- widthGrowthSpeed → double
-
The speed at which the line is growing, defined in points per second.
final
- widthMode → EffectLineWidthMode
-
Mode used to calculate the width of the line.
final
- zPosition ↔ double
-
The draw order of this node compared to its parent and its siblings.
getter/setter pairinherited
Methods
-
addChild(
Node child) → void -
Adds a child to this node.
inherited
-
addPoint(
Offset point) → void - Adds a new point to the end of the line.
-
applyConstraints(
double dt) → void -
Called to apply the constraints to the node. Normally, this method is
called automatically by the SpriteBox, but it can be called manually
if the constraints need to be applied immediately.
inherited
-
computeTransformMatrix(
) → Matrix4 -
Computes the transformation matrix of this node. This method can be
overriden if a custom matrix is required. There is usually no reason to
call this method directly.
inherited
-
convertPointFromNode(
Offset point, Node node) → Offset -
Converts a
point
from anothernode
s coordinate system into the local coordinate system of this node.inherited -
convertPointToBoxSpace(
Offset nodePoint) → Offset -
Converts a point from the local coordinate system of the node to the
coordinate system of the SpriteBox.
inherited
-
convertPointToNodeSpace(
Offset boxPoint) → Offset -
Converts a point from the coordinate system of the SpriteBox to the
local coordinate system of the node.
inherited
-
handleEvent(
SpriteBoxEvent event) → bool -
Handles an event, such as a pointer (touch or mouse) event.
inherited
-
handleKeyboardEvent(
KeyEvent event) → bool -
Handles a keyboard event.
inherited
-
invalidateTransformMatrix(
) → void -
Invalidates the current transform matrix. If the computeTransformMatrix
method is overidden, this method should be called whenever a property
changes that affects the matrix.
inherited
-
isPointInside(
Offset point) → bool -
Returns true if the
point
is inside the node, thepoint
is in the local coordinate system of the node.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
paint(
Canvas canvas) → void -
Paints this node to the canvas.
override
-
removeAllChildren(
) → void -
Removes all children of this node.
inherited
-
removeChild(
Node child) → void -
Removes a child from this node.
inherited
-
removeFromParent(
) → void -
Removes this node from its parent node.
inherited
-
spriteBoxPerformedLayout(
) → void -
Called whenever the SpriteBox is modified or resized, or if the device
is rotated.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
update(
double dt) → void -
Called before a frame is drawn.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited