load static method
- Iterable<
ParallaxData> dataList, { - Vector2? baseVelocity,
- Vector2? velocityMultiplierDelta,
- ImageRepeat repeat = ImageRepeat.repeatX,
- Alignment alignment = Alignment.bottomLeft,
- LayerFill fill = LayerFill.height,
- Images? images,
- Vector2? position,
- Vector2? size,
- Vector2? scale,
- double? angle,
- Anchor? anchor,
- int? priority,
Note that this method only should be used if all of your layers should
have the same layer arguments (how the images should be repeated, aligned
and filled), otherwise load the ParallaxLayer
s individually and use the
normal constructor.
load takes a list of ParallaxData
of all the images and a size that
you want to use in the parallax.
Optionally arguments for the baseVelocity
and velocityMultiplierDelta
can be passed in, baseVelocity
defines what the base velocity of the
layers should be and velocityMultiplierDelta
defines how the velocity
should change the closer the layer is (velocityMultiplierDelta ^ n
,
where n
is the layer index).
Arguments for how all the images should repeat (repeat
),
which edge it should align with (alignment
), which axis it should fill
the image on (fill
) and images
which is the image cache that should be
used can also be passed in.
If no image cache is set, the global flame cache is used.
Implementation
static Future<ParallaxComponent> load(
Iterable<ParallaxData> dataList, {
Vector2? baseVelocity,
Vector2? velocityMultiplierDelta,
ImageRepeat repeat = ImageRepeat.repeatX,
Alignment alignment = Alignment.bottomLeft,
LayerFill fill = LayerFill.height,
Images? images,
Vector2? position,
Vector2? size,
Vector2? scale,
double? angle,
Anchor? anchor,
int? priority,
}) async {
return ParallaxComponent(
parallax: await Parallax.load(
dataList,
size: size,
baseVelocity: baseVelocity,
velocityMultiplierDelta: velocityMultiplierDelta,
repeat: repeat,
alignment: alignment,
fill: fill,
images: images,
),
position: position,
size: size,
scale: scale,
angle: angle,
anchor: anchor,
priority: priority,
);
}