ParallaxComponent<T extends FlameGame<World>> constructor

ParallaxComponent<T extends FlameGame<World>>({
  1. Parallax? parallax,
  2. Vector2? position,
  3. Vector2? size,
  4. Vector2? scale,
  5. double? angle,
  6. Anchor? anchor,
  7. Iterable<Component>? children,
  8. int? priority,
  9. ComponentKey? key,
})

Creates a component with an empty parallax which can be set later.

Implementation

ParallaxComponent({
  Parallax? parallax,
  super.position,
  Vector2? size,
  super.scale,
  super.angle,
  super.anchor,
  super.children,
  super.priority,
  super.key,
})  : _parallax = parallax,
      isFullscreen = size == null && !(parallax?.isSized ?? false),
      super(
        size: size ?? ((parallax?.isSized ?? false) ? parallax?.size : null),
      );