mirror of
https://github.com/bevyengine/bevy
synced 2024-12-20 01:53:12 +00:00
Improve ZIndex docs (#16536)
# Objective - In 0.14, ZIndex and GlobalZIndex where split from a shared enum into separate components. There have been a few people confused by the behavior of ZIndex when they really needed GlobalZIndex. ## Solution - Update ZIndex docs to improve discoverability of GlobalZIndex. --------- Co-authored-by: Benjamin Brienen <benjamin.brienen@outlook.com>
This commit is contained in:
parent
740e8f74dd
commit
696c00641f
1 changed files with 4 additions and 1 deletions
|
@ -2063,13 +2063,16 @@ pub struct CalculatedClip {
|
||||||
|
|
||||||
/// Indicates that this [`Node`] entity's front-to-back ordering is not controlled solely
|
/// Indicates that this [`Node`] entity's front-to-back ordering is not controlled solely
|
||||||
/// by its location in the UI hierarchy. A node with a higher z-index will appear on top
|
/// by its location in the UI hierarchy. A node with a higher z-index will appear on top
|
||||||
/// of other nodes with a lower z-index.
|
/// of sibling nodes with a lower z-index.
|
||||||
///
|
///
|
||||||
/// UI nodes that have the same z-index will appear according to the order in which they
|
/// UI nodes that have the same z-index will appear according to the order in which they
|
||||||
/// appear in the UI hierarchy. In such a case, the last node to be added to its parent
|
/// appear in the UI hierarchy. In such a case, the last node to be added to its parent
|
||||||
/// will appear in front of its siblings.
|
/// will appear in front of its siblings.
|
||||||
///
|
///
|
||||||
/// Nodes without this component will be treated as if they had a value of [`ZIndex(0)`].
|
/// Nodes without this component will be treated as if they had a value of [`ZIndex(0)`].
|
||||||
|
///
|
||||||
|
/// Use [`GlobalZIndex`] if you need to order separate UI hierarchies or nodes that are
|
||||||
|
/// not siblings in a given UI hierarchy.
|
||||||
#[derive(Component, Copy, Clone, Debug, Default, PartialEq, Eq, Reflect)]
|
#[derive(Component, Copy, Clone, Debug, Default, PartialEq, Eq, Reflect)]
|
||||||
#[reflect(Component, Default, Debug, PartialEq)]
|
#[reflect(Component, Default, Debug, PartialEq)]
|
||||||
pub struct ZIndex(pub i32);
|
pub struct ZIndex(pub i32);
|
||||||
|
|
Loading…
Reference in a new issue