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. Child 2D nodes will display on it, and child 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¶
find_world_2d ( ) const |
|
find_world_3d ( ) const |
|
get_camera_2d ( ) const |
|
get_camera_3d ( ) const |
|
get_canvas_cull_mask_bit ( int layer ) const |
|
get_embedded_subwindows ( ) const |
|
get_final_transform ( ) const |
|
get_mouse_position ( ) const |
|
get_positional_shadow_atlas_quadrant_subdiv ( int quadrant ) const |
|
get_render_info ( RenderInfoType type, RenderInfo info ) |
|
get_screen_transform ( ) const |
|
get_texture ( ) const |
|
get_viewport_rid ( ) const |
|
get_visible_rect ( ) const |
|
gui_get_drag_data ( ) const |
|
gui_get_focus_owner ( ) const |
|
gui_is_drag_successful ( ) const |
|
gui_is_dragging ( ) const |
|
void |