Skip to main content

Viewport

Inherits: Node < Object

Description

Abstract base class for viewports. Encapsulates drawing and interaction with a game world. A Viewport creates a different view into the screen, or a sub-view inside another viewport.

Properties

bool
default:"false"
If true, the viewport should render its background as transparent.
MSAA
default:"MSAA_DISABLED"
The multisample antialiasing mode for 2D/Canvas rendering.
MSAA
default:"MSAA_DISABLED"
The multisample antialiasing mode for 3D rendering.

Methods

get_camera_2d

Returns the currently active 2D camera.

get_camera_3d

Returns the currently active 3D camera.

get_mouse_position

Returns the mouse’s position in this Viewport.

get_texture

Returns the viewport’s texture.

set_input_as_handled

Stops the input from propagating further up the SceneTree.

Signals

size_changed()

Emitted when the size of the viewport is changed.

Example Usage