CameraComponent constructor
CameraComponent({
- World? world,
- Viewport? viewport,
- Viewfinder? viewfinder,
- Component? backdrop,
- List<
Component> ? hudComponents, - 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]);
}