camera property

  1. @override
  2. @Deprecated('Sashimi does not use the built-in camera, use `kamera` instead.')
dynamic camera

The component that is responsible for rendering your world.

In this component you can set different viewports, viewfinders, follow components, set bounds for where the camera can move etc.

You don't have to add the CameraComponent to the tree after setting it here, it is done automatically.

When setting the camera, if it doesn't already have a world it will be set to match the game's world.

Implementation

@override
@Deprecated('Sashimi does not use the built-in camera, use `kamera` instead.')
game.Camera get camera => super.camera;
void camera=(CameraComponent newCameraComponent)
inherited

Implementation

set camera(CameraComponent newCameraComponent) {
  _camera.removeFromParent();
  _camera = newCameraComponent;
  if (_camera.parent == null) {
    add(_camera);
  }
  _camera.world ??= world;
}