-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve canvas layer index documentation #81270
Improve canvas layer index documentation #81270
Conversation
doc/classes/CanvasLayer.xml
Outdated
@@ -53,6 +53,7 @@ | |||
</member> | |||
<member name="layer" type="int" setter="set_layer" getter="get_layer" default="1"> | |||
Layer index for draw order. Lower values are drawn behind higher values. | |||
[b]Note:[/b] If multiple CanvasLayers have the same layer index, [CanvasItem]-children of one CanvasLayer are drawn behind the [CanvasItem]-children of the other CanvasLayer. Which CanvasLayer is drawn in front is non-deterministic. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it really non-deterministic, or is it in scene tree order of the CanvasLayers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not only the scene tree order. You can see that in the Video of the linked issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See also #69952 which made canvas layer ordering deterministic in 3.x (i.e. that PR makes layers render in scene tree order).
It may be an idea to say nothing about the determinism until this is fixed in 4.x.
If I remember correctly, the canvas layers were previously sorted by RID in 3.x, which was kind of haphazard and pseudo-deterministic. I don't know the current situation in 4.x.
This comment suggests it may be deterministic in 4.x, so maybe it warrants some investigation / issue:
#25384 (comment)
Document special case of identical canvas layer index.
1489d56
to
fffbb42
Compare
Thanks! |
Document special case of identical canvas layer index.
resolve #81257
related to #81262