From 879f84d8f8e7d9467bb9049b445d576916c847c0 Mon Sep 17 00:00:00 2001 From: Josh Chandler Date: Tue, 28 Apr 2020 11:04:07 -0400 Subject: add viewport.get_camera_2d() * there is now a more clear distinction between camera_2d and camera_3d functions in the engine code * simplified camera2d's exported interface - now everything happens directly with the 'current' variable and make_current and clear_current are no longer exposed- there were some situations where calling one instead of set_current would result in incomplete results * rebased to current godot master --- doc/classes/Camera2D.xml | 16 +--------------- doc/classes/Camera3D.xml | 4 ++-- doc/classes/Viewport.xml | 11 +++++++++-- 3 files changed, 12 insertions(+), 19 deletions(-) (limited to 'doc/classes') diff --git a/doc/classes/Camera2D.xml b/doc/classes/Camera2D.xml index 4620b3d93c..e8f4cb49b6 100644 --- a/doc/classes/Camera2D.xml +++ b/doc/classes/Camera2D.xml @@ -21,13 +21,6 @@ Aligns the camera to the tracked node. - - - - - Removes any [Camera2D] from the ancestor [Viewport]'s internal currently-assigned camera. - - @@ -67,13 +60,6 @@ Returns the camera limit for the specified [enum Side]. See also [member limit_bottom], [member limit_top], [member limit_left], and [member limit_right]. - - - - - Make this the current 2D camera for the scene (viewport and layer), in case there are many cameras in the scene. - - @@ -109,7 +95,7 @@ The Camera2D's anchor point. See [enum AnchorMode] constants. - + If [code]true[/code], the camera is the active camera for the current scene. Only one camera can be current, so setting a different camera [code]current[/code] will disable this one. diff --git a/doc/classes/Camera3D.xml b/doc/classes/Camera3D.xml index afba478a20..0f0bfdc654 100644 --- a/doc/classes/Camera3D.xml +++ b/doc/classes/Camera3D.xml @@ -176,8 +176,8 @@ [codeblock] # This code block is part of a script that inherits from Node3D. # `control` is a reference to a node inheriting from Control. - control.visible = not get_viewport().get_camera().is_position_behind(global_transform.origin) - control.rect_position = get_viewport().get_camera().unproject_position(global_transform.origin) + control.visible = not get_viewport().get_camera_3d().is_position_behind(global_transform.origin) + control.rect_position = get_viewport().get_camera_3d().unproject_position(global_transform.origin) [/codeblock] diff --git a/doc/classes/Viewport.xml b/doc/classes/Viewport.xml index 00827fe324..bf58dc4d8c 100644 --- a/doc/classes/Viewport.xml +++ b/doc/classes/Viewport.xml @@ -36,11 +36,18 @@ Returns the 3D world of the viewport, or if none the world of the parent viewport. - + + + + + Returns the currently active 2D camera. Returns null if there are no active cameras. + + + - Returns the active 3D camera. + Returns the currently active 3D camera. -- cgit v1.2.3