Up to date
This page is up to date for Godot 4.2
.
If you still find outdated information, please open an issue.
Viewport¶
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¶
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
Methods¶
Signals¶
gui_focus_changed ( Control node )
Emitted when a Control node grabs keyboard focus.
size_changed ( )
Emitted when the size of the viewport is changed, whether by resizing of window, or some other means.
Enumerations¶
enum PositionalShadowAtlasQuadrantSubdiv:
PositionalShadowAtlasQuadrantSubdiv SHADOW_ATLAS_QUADRANT_SUBDIV_DISABLED = 0
This quadrant will not be used.
PositionalShadowAtlasQuadrantSubdiv SHADOW_ATLAS_QUADRANT_SUBDIV_1 = 1
This quadrant will only be used by one shadow map.
PositionalShadowAtlasQuadrantSubdiv SHADOW_ATLAS_QUADRANT_SUBDIV_4 = 2
This quadrant will be split in 4 and used by up to 4 shadow maps.
PositionalShadowAtlasQuadrantSubdiv SHADOW_ATLAS_QUADRANT_SUBDIV_16 = 3
This quadrant will be split 16 ways and used by up to 16 shadow maps.