-
Notifications
You must be signed in to change notification settings - Fork 0
class_viewport
####Inherits: Node ####Category: Core
Creates a sub-view into the screen.
- void set_rect ( Rect2 rect )
- Rect2 get_rect ( ) const
- World2D find_world_2d ( ) const
- void set_world ( World world )
- World get_world ( ) const
- World find_world ( ) const
- void set_canvas_transform ( Matrix32 xform )
- Matrix32 get_canvas_transform ( ) const
- void set_global_canvas_transform ( Matrix32 xform )
- Matrix32 get_global_canvas_transform ( ) const
- Matrix32 get_final_transform ( ) const
- Rect2 get_visible_rect ( ) const
- void set_transparent_background ( bool enable )
- bool has_transparent_background ( ) const
- void set_size_override ( bool enable, Vector2 size=Vector2(-1,-1), Vector2 margin=Vector2(0,0) )
- Vector2 get_size_override ( ) const
- bool is_size_override_enabled ( ) const
- void set_size_override_stretch ( bool enabled )
- bool is_size_override_stretch_enabled ( ) const
- void queue_screen_capture ( )
- Image get_screen_capture ( ) const
- void set_as_render_target ( bool enable )
- bool is_set_as_render_target ( ) const
- void set_render_target_vflip ( bool enable )
- bool get_render_target_vflip ( ) const
- void set_render_target_clear_on_new_frame ( bool enable )
- bool get_render_target_clear_on_new_frame ( ) const
- void render_target_clear ( )
- void set_render_target_filter ( bool enable )
- bool get_render_target_filter ( ) const
- void set_render_target_gen_mipmaps ( bool enable )
- bool get_render_target_gen_mipmaps ( ) const
- void set_render_target_update_mode ( int mode )
- int get_render_target_update_mode ( ) const
- RenderTargetTexture get_render_target_texture ( ) const
- void set_physics_object_picking ( bool enable )
- bool get_physics_object_picking ( )
- RID get_viewport ( ) const
- void input ( InputEvent local_event )
- void unhandled_input ( InputEvent local_event )
- void update_worlds ( )
- void set_use_own_world ( bool enable )
- bool is_using_own_world ( ) const
- Camera get_camera ( ) const
- void set_as_audio_listener ( bool enable )
- bool is_audio_listener ( ) const
- void set_as_audio_listener_2d ( bool enable )
- bool is_audio_listener_2d ( ) const
- void set_render_target_to_screen_rect ( Rect2 arg0 )
- Vector2 get_mouse_pos ( ) const
- void warp_mouse ( Vector2 to_pos )
- size_changed ( )
- RENDER_TARGET_UPDATE_DISABLED = 0
- RENDER_TARGET_UPDATE_ONCE = 1
- RENDER_TARGET_UPDATE_WHEN_VISIBLE = 2
- RENDER_TARGET_UPDATE_ALWAYS = 3
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 Camera 3D nodes will renderon it too.
Optionally, a viewport can have it's own 2D or 3D world, so they don't share what they draw with other viewports.
If a viewport is a child of a [Control](class_control), it will automatically take up it's same rect and position, otherwise they must be set manually.
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 the situation while devices have multiple screens.
Finaly, viewports can also behave as render targets, in which case they will not be visible unless the associated texture is used to draw.
- void set_rect ( Rect2 rect )
Set the viewport rect. If the viewport is child of a control, it will use the same as the parent.
- Rect2 get_rect ( ) const
Return the viewport rect. If the viewport is child of a control, it will use the same as the parent, otherwise if the rect is empty, the viewport will use all the allowed space.
- Rect2 get_visible_rect ( ) const
Return the final, visuble rect in global screen coordinates.
- void set_transparent_background ( bool enable )
Keep whathver the parent viewport has drawn
- bool has_transparent_background ( ) const
If this viewport is a child of another viewport, keep the previously drawn background visible.
- RID get_viewport ( ) const
Get the viewport RID from the visual server.