diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-07-20 22:19:06 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-20 22:19:06 +0200 |
commit | c82daaed483e7ab7df7e44c2d01a906154801905 (patch) | |
tree | 43d175b117dc6431f82b426e75ba71839fc48ddc /doc/classes | |
parent | 693f9b4e20f76d56ead91f8a8cad204516d2d953 (diff) | |
parent | 879f84d8f8e7d9467bb9049b445d576916c847c0 (diff) |
Merge pull request #38317 from verdog/get-cam-2d-4.0
add viewport.get_camera_2d()
Diffstat (limited to 'doc/classes')
-rw-r--r-- | doc/classes/Camera2D.xml | 16 | ||||
-rw-r--r-- | doc/classes/Camera3D.xml | 4 | ||||
-rw-r--r-- | doc/classes/Viewport.xml | 11 |
3 files changed, 12 insertions, 19 deletions
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. </description> </method> - <method name="clear_current"> - <return type="void"> - </return> - <description> - Removes any [Camera2D] from the ancestor [Viewport]'s internal currently-assigned camera. - </description> - </method> <method name="force_update_scroll"> <return type="void"> </return> @@ -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]. </description> </method> - <method name="make_current"> - <return type="void"> - </return> - <description> - Make this the current 2D camera for the scene (viewport and layer), in case there are many cameras in the scene. - </description> - </method> <method name="reset_smoothing"> <return type="void"> </return> @@ -109,7 +95,7 @@ <member name="anchor_mode" type="int" setter="set_anchor_mode" getter="get_anchor_mode" enum="Camera2D.AnchorMode" default="1"> The Camera2D's anchor point. See [enum AnchorMode] constants. </member> - <member name="current" type="bool" setter="_set_current" getter="is_current" default="false"> + <member name="current" type="bool" setter="set_current" getter="is_current" default="false"> 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. </member> <member name="custom_viewport" type="Node" setter="set_custom_viewport" getter="get_custom_viewport"> 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] </description> </method> 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. </description> </method> - <method name="get_camera" qualifiers="const"> + <method name="get_camera_2d" qualifiers="const"> + <return type="Camera2D"> + </return> + <description> + Returns the currently active 2D camera. Returns null if there are no active cameras. + </description> + </method> + <method name="get_camera_3d" qualifiers="const"> <return type="Camera3D"> </return> <description> - Returns the active 3D camera. + Returns the currently active 3D camera. </description> </method> <method name="get_final_transform" qualifiers="const"> |