CameraComponent constructor

CameraComponent({
  1. World? world,
  2. Viewport? viewport,
  3. Viewfinder? viewfinder,
  4. Component? backdrop,
  5. List<Component>? hudComponents,
  6. ComponentKey? key,
})

Implementation

CameraComponent({
  this.world,
  Viewport? viewport,
  Viewfinder? viewfinder,
  Component? backdrop,
  List<Component>? hudComponents,
  super.key,
})  : _viewport = (viewport ?? MaxViewport())..addAll(hudComponents ?? []),
      _viewfinder = viewfinder ?? Viewfinder(),
      _backdrop = backdrop ?? Component(),
      // The priority is set to the max here to avoid some bugs for the users,
      // if they for example would add any components that modify positions
      // before the CameraComponent, since it then will render the positions
      // of the last tick each tick.
      super(priority: 0x7fffffff) {
  addAll([_backdrop, _viewport, _viewfinder]);
}