summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYuri Sizov <11782833+YuriSizov@users.noreply.github.com>2023-06-02 12:53:45 +0200
committerGitHub <noreply@github.com>2023-06-02 12:53:45 +0200
commiteab4075f1ec76ddc55a4b33344ff8636c7ebbdf2 (patch)
tree1fb1831b3f805ff8df7b5e2e44205f87fe270bff
parent2a50f8c10762ef0176ce15e8c6f13e0d7c890f10 (diff)
parentf5b6661c3e964681d1dcc77ec9f372a15690f780 (diff)
downloadredot-engine-eab4075f1ec76ddc55a4b33344ff8636c7ebbdf2.tar.gz
Merge pull request #77727 from AThousandShips/layer_doc
Clarify that `CanvasLayer`s are restricted to one `Viewport`
-rw-r--r--doc/classes/CanvasLayer.xml1
-rw-r--r--doc/classes/ParallaxBackground.xml1
2 files changed, 2 insertions, 0 deletions
diff --git a/doc/classes/CanvasLayer.xml b/doc/classes/CanvasLayer.xml
index 15e49c018d..e85ab6c21f 100644
--- a/doc/classes/CanvasLayer.xml
+++ b/doc/classes/CanvasLayer.xml
@@ -7,6 +7,7 @@
[CanvasItem]-derived nodes that are direct or indirect children of a [CanvasLayer] will be drawn in that layer. The layer is a numeric index that defines the draw order. The default 2D scene renders with index [code]0[/code], so a [CanvasLayer] with index [code]-1[/code] will be drawn below, and a [CanvasLayer] with index [code]1[/code] will be drawn above. This order will hold regardless of the [member CanvasItem.z_index] of the nodes within each layer.
[CanvasLayer]s can be hidden and they can also optionally follow the viewport. This makes them useful for HUDs like health bar overlays (on layers [code]1[/code] and higher) or backgrounds (on layers [code]-1[/code] and lower).
[b]Note:[/b] Embedded [Window]s are placed on layer [code]1024[/code]. [CanvasItem]s on layers [code]1025[/code] and higher appear in front of embedded windows.
+ [b]Note:[/b] Each [CanvasLayer] is drawn on one specific [Viewport] and cannot be shared between multiple [Viewport]s, see [member custom_viewport]. When using multiple [Viewport]s, for example in a split-screen game, you need create an individual [CanvasLayer] for each [Viewport] you want it to be drawn on.
</description>
<tutorials>
<link title="Viewport and canvas transforms">$DOCS_URL/tutorials/2d/2d_transforms.html</link>
diff --git a/doc/classes/ParallaxBackground.xml b/doc/classes/ParallaxBackground.xml
index 050b4b0e82..76dcf6e83a 100644
--- a/doc/classes/ParallaxBackground.xml
+++ b/doc/classes/ParallaxBackground.xml
@@ -5,6 +5,7 @@
</brief_description>
<description>
A ParallaxBackground uses one or more [ParallaxLayer] child nodes to create a parallax effect. Each [ParallaxLayer] can move at a different speed using [member ParallaxLayer.motion_offset]. This creates an illusion of depth in a 2D game. If not used with a [Camera2D], you must manually calculate the [member scroll_offset].
+ [b]Note:[/b] Each [ParallaxBackground] is drawn on one specific [Viewport] and cannot be shared between multiple [Viewport]s, see [member CanvasLayer.custom_viewport]. When using multiple [Viewport]s, for example in a split-screen game, you need create an individual [ParallaxBackground] for each [Viewport] you want it to be drawn on.
</description>
<tutorials>
</tutorials>