Forge2DGame<T extends Forge2DWorld> constructor

Forge2DGame<T extends Forge2DWorld>({
  1. Forge2DWorld? world,
  2. CameraComponent? camera,
  3. @Deprecated('Use the `camera` argument instead') CameraComponent? cameraComponent,
  4. Vector2? gravity,
  5. ContactListener? contactListener,
  6. double zoom = 10,
})

Implementation

Forge2DGame({
  Forge2DWorld? world,
  CameraComponent? camera,
  @Deprecated('Use the `camera` argument instead')
  CameraComponent? cameraComponent,
  Vector2? gravity,
  ContactListener? contactListener,
  double zoom = 10,
}) : super(
        world: ((world?..gravity = gravity ?? world.gravity) ??
            Forge2DWorld(
              gravity: gravity,
              contactListener: contactListener,
            )) as T,
        camera: (camera ?? cameraComponent ?? CameraComponent())
          ..viewfinder.zoom = zoom,
      );