viewport property

Viewport viewport

The viewport is the "window" through which the game world is observed.

Imagine that the world is covered with an infinite sheet of paper, but there is a hole in it. That hole is the viewport: through that aperture the world can be observed. The viewport's size is equal to or smaller than the size of the game canvas. If it is smaller, then the viewport's position specifies where exactly it is placed on the canvas.

Implementation

Viewport get viewport => _viewport;
void viewport=(Viewport newViewport)

Implementation

set viewport(Viewport newViewport) {
  _viewport.removeFromParent();
  _viewport = newViewport;
  add(_viewport);
  _viewfinder.updateTransform();
}