Forge2DGame<T extends Forge2DWorld> constructor
Forge2DGame<T extends Forge2DWorld> ({
- Forge2DWorld? world,
- CameraComponent? camera,
- @Deprecated('Use the `camera` argument instead') CameraComponent? cameraComponent,
- Vector2? gravity,
- ContactListener? contactListener,
- 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,
);