ParallaxComponent<T extends FlameGame> constructor

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

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

Implementation

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