diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-04-16 12:28:35 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-16 12:28:35 +0200 |
commit | a29d475e67d608420498bae78fbb8700d5123748 (patch) | |
tree | 082029bb1d4a443af63feae32c56ab6ec24486b5 /doc | |
parent | 2ebfd691966b68b03dd4aa73d6d16db0e085db21 (diff) | |
parent | 630096fa74be116ede7b4964e2ed6b1dca4017f0 (diff) |
Merge pull request #37747 from KoBeWi/cam2center
Improve Camera2D documentation
Diffstat (limited to 'doc')
-rw-r--r-- | doc/classes/Camera2D.xml | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/doc/classes/Camera2D.xml b/doc/classes/Camera2D.xml index 73892481e6..ad49216b34 100644 --- a/doc/classes/Camera2D.xml +++ b/doc/classes/Camera2D.xml @@ -5,7 +5,8 @@ </brief_description> <description> Camera node for 2D scenes. It forces the screen (current layer) to scroll following this node. This makes it easier (and faster) to program scrollable scenes than manually changing the position of [CanvasItem]-based nodes. - This node is intended to be a simple helper to get things going quickly and it may happen that more functionality is desired to change how the camera works. To make your own custom camera node, simply inherit from [Node2D] and change the transform of the canvas by calling get_viewport().set_canvas_transform(m) in [Viewport]. + This node is intended to be a simple helper to get things going quickly and it may happen that more functionality is desired to change how the camera works. To make your own custom camera node, inherit from [Node2D] and change the transform of the canvas by setting [member Viewport.canvas_transform] in [Viewport] (you can obtain the current [Viewport] by using [method Node.get_viewport]). + Note that the [Camera2D] node's [code]position[/code] doesn't represent the actual position of the screen, which may differ due to applied smoothing or limits. You can use [method get_camera_screen_center] to get the real position. </description> <tutorials> </tutorials> |