Attention: Here be dragons

This is the latest (unstable) version of this documentation, which may document features not available in or compatible with released stable versions of Godot.

Viewport

Inherits: Node < Object

Inherited By: SubViewport, Window

Abstract base class for viewports. Encapsulates drawing and interaction with a game world.

Description

A Viewport creates a different view into the screen, or a sub-view inside another viewport. Children 2D Nodes will display on it, and children Camera3D 3D nodes will render on it too.

Optionally, a viewport can have its own 2D or 3D world, so it doesn't share what it draws with other viewports.

Viewports can also choose to be audio listeners, so they generate positional audio depending on a 2D or 3D camera child of it.

Also, viewports can be assigned to different screens in case the devices have multiple screens.

Finally, viewports can also behave as render targets, in which case they will not be visible unless the associated texture is used to draw.

Tutorials

Properties

bool

audio_listener_enable_2d

false

bool

audio_listener_enable_3d

false

int

canvas_cull_mask

4294967295

DefaultCanvasItemTextureFilter

canvas_item_default_texture_filter

1

DefaultCanvasItemTextureRepeat

canvas_item_default_texture_repeat

0

Transform2D

canvas_transform

DebugDraw

debug_draw

0

bool

<