summaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorAdriaan de Jongh <5611323+AdriaandeJongh@users.noreply.github.com>2024-04-01 13:47:36 +0200
committerAdriaan de Jongh <5611323+AdriaandeJongh@users.noreply.github.com>2024-04-02 09:43:18 +0200
commit7d8cd49737275429e30a641b430a5c2037c4eb14 (patch)
tree36100c069202dff0247b4a0a0b26ecc0bf9a0699 /doc
parent29b3d9e9e538f0aa8effc8ad8bf19a2915292a89 (diff)
downloadredot-engine-7d8cd49737275429e30a641b430a5c2037c4eb14.tar.gz
improve description of y_sort_enabled
Diffstat (limited to 'doc')
-rw-r--r--doc/classes/CanvasItem.xml7
1 files changed, 4 insertions, 3 deletions
diff --git a/doc/classes/CanvasItem.xml b/doc/classes/CanvasItem.xml
index 72783bc5d6..5ca03e4838 100644
--- a/doc/classes/CanvasItem.xml
+++ b/doc/classes/CanvasItem.xml
@@ -606,14 +606,15 @@
[b]Note:[/b] For controls that inherit [Popup], the correct way to make them visible is to call one of the multiple [code]popup*()[/code] functions instead.
</member>
<member name="y_sort_enabled" type="bool" setter="set_y_sort_enabled" getter="is_y_sort_enabled" default="false">
- If [code]true[/code], this [CanvasItem] and its [CanvasItem] child nodes are sorted according to the Y position. Nodes with a lower Y position are drawn before those with a higher Y position. If [code]false[/code], Y-sorting is disabled.
- You can nest nodes with Y-sorting. Child Y-sorted nodes are sorted in the same space as the parent Y-sort. This feature allows you to organize a scene better or divide it into multiple ones without changing your scene tree.
+ If [code]true[/code], this and child [CanvasItem] nodes with a lower Y position are rendered in front of nodes with a higher Y position. If [code]false[/code], this and child [CanvasItem] nodes are rendered normally in scene tree order.
+ With Y-sorting enabled on a parent node ('A') but disabled on a child node ('B'), the child node ('B') is sorted but its children ('C1', 'C2', etc) render together on the same Y position as the child node 'B'. This allows you to organize the render order of a scene without changing the scene tree.
+ Nodes sort relative to each other only if they are on the same [member z_index].
</member>
<member name="z_as_relative" type="bool" setter="set_z_as_relative" getter="is_z_relative" default="true">
If [code]true[/code], the node's Z index is relative to its parent's Z index. If this node's Z index is 2 and its parent's effective Z index is 3, then this node's effective Z index will be 2 + 3 = 5.
</member>
<member name="z_index" type="int" setter="set_z_index" getter="get_z_index" default="0">
- Z index. Controls the order in which the nodes render. A node with a higher Z index will display in front of others. Must be between [constant RenderingServer.CANVAS_ITEM_Z_MIN] and [constant RenderingServer.CANVAS_ITEM_Z_MAX] (inclusive).
+ Controls the order in which the nodes render. A node with a higher Z index will display in front of others. Must be between [constant RenderingServer.CANVAS_ITEM_Z_MIN] and [constant RenderingServer.CANVAS_ITEM_Z_MAX] (inclusive).
[b]Note:[/b] Changing the Z index of a [Control] only affects the drawing order, not the order in which input events are handled. This can be useful to implement certain UI animations, e.g. a menu where hovered items are scaled and should overlap others.
</member>
</members>