summaryrefslogtreecommitdiff
path: root/doc/classes
diff options
context:
space:
mode:
authorJosh Chandler <j5d1c7@gmail.com>2020-04-28 11:04:07 -0400
committerJosh Chandler <j5d1c7@gmail.com>2021-07-03 15:08:17 -0400
commit879f84d8f8e7d9467bb9049b445d576916c847c0 (patch)
treee824ecb7e4670b4e0ede7de99f0f21e2254acec1 /doc/classes
parente849dc1791cd064b3b9736ac91f0ae9fae3bc8d9 (diff)
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
Diffstat (limited to 'doc/classes')
-rw-r--r--doc/classes/Camera2D.xml16
-rw-r--r--doc/classes/Camera3D.xml4
-rw-r--r--doc/classes/Viewport.xml11
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">