pub enum ZIndex {
Local(i32),
Global(i32),
}
Expand description
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
of other nodes with a lower z-index.
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 will appear in front of this parent’s other children.
Internally, nodes with a global z-index share the stacking context of root UI nodes
(nodes that have no parent). Because of this, there is no difference between using
[ZIndex::Local(n)
] and [ZIndex::Global(n)
] for root nodes.
Nodes without this component will be treated as if they had a value of [ZIndex::Local(0)
].
Variants§
Local(i32)
Indicates the order in which this node should be rendered relative to its siblings.
Global(i32)
Indicates the order in which this node should be rendered relative to root nodes and all other nodes that have a global z-index.
Trait Implementations§
§impl Enum for ZIndexwhere
i32: FromReflect,
impl Enum for ZIndexwhere i32: FromReflect,
§fn field(&self, __name_param: &str) -> Option<&(dyn Reflect + 'static)>
fn field(&self, __name_param: &str) -> Option<&(dyn Reflect + 'static)>
§fn field_at(&self, __index_param: usize) -> Option<&(dyn Reflect + 'static)>
fn field_at(&self, __index_param: usize) -> Option<&(dyn Reflect + 'static)>
§fn field_mut(
&mut self,
__name_param: &str
) -> Option<&mut (dyn Reflect + 'static)>
fn field_mut( &mut self, __name_param: &str ) -> Option<&mut (dyn Reflect + 'static)>
§fn field_at_mut(
&mut self,
__index_param: usize
) -> Option<&mut (dyn Reflect + 'static)>
fn field_at_mut( &mut self, __index_param: usize ) -> Option<&mut (dyn Reflect + 'static)>
§fn index_of(&self, __name_param: &str) -> Option<usize>
fn index_of(&self, __name_param: &str) -> Option<usize>
§fn name_at(&self, __index_param: usize) -> Option<&str>
fn name_at(&self, __index_param: usize) -> Option<&str>
§fn iter_fields(&self) -> VariantFieldIter<'_> ⓘ
fn iter_fields(&self) -> VariantFieldIter<'_> ⓘ
§fn variant_name(&self) -> &str
fn variant_name(&self) -> &str
§fn variant_index(&self) -> usize
fn variant_index(&self) -> usize
§fn variant_type(&self) -> VariantType
fn variant_type(&self) -> VariantType
fn clone_dynamic(&self) -> DynamicEnum
§fn is_variant(&self, variant_type: VariantType) -> bool
fn is_variant(&self, variant_type: VariantType) -> bool
§fn variant_path(&self) -> String
fn variant_path(&self) -> String
§impl GetTypeRegistration for ZIndexwhere
i32: FromReflect,
impl GetTypeRegistration for ZIndexwhere i32: FromReflect,
§impl Reflect for ZIndexwhere
i32: FromReflect,
impl Reflect for ZIndexwhere i32: FromReflect,
§fn get_type_info(&self) -> &'static TypeInfo
fn get_type_info(&self) -> &'static TypeInfo
§fn into_any(self: Box<ZIndex, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<ZIndex, Global>) -> Box<dyn Any + 'static, Global>
Box<dyn Any>
.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut dyn Any
.§fn into_reflect(self: Box<ZIndex, Global>) -> Box<dyn Reflect + 'static, Global>
fn into_reflect(self: Box<ZIndex, Global>) -> Box<dyn Reflect + 'static, Global>
§fn as_reflect(&self) -> &(dyn Reflect + 'static)
fn as_reflect(&self) -> &(dyn Reflect + 'static)
§fn as_reflect_mut(&mut self) -> &mut (dyn Reflect + 'static)
fn as_reflect_mut(&mut self) -> &mut (dyn Reflect + 'static)
§fn clone_value(&self) -> Box<dyn Reflect + 'static, Global>
fn clone_value(&self) -> Box<dyn Reflect + 'static, Global>
Reflect
trait object. Read more§fn set(
&mut self,
__value_param: Box<dyn Reflect + 'static, Global>
) -> Result<(), Box<dyn Reflect + 'static, Global>>
fn set( &mut self, __value_param: Box<dyn Reflect + 'static, Global> ) -> Result<(), Box<dyn Reflect + 'static, Global>>
§fn apply(&mut self, __value_param: &(dyn Reflect + 'static))
fn apply(&mut self, __value_param: &(dyn Reflect + 'static))
§fn reflect_ref(&self) -> ReflectRef<'_>
fn reflect_ref(&self) -> ReflectRef<'_>
§fn reflect_mut(&mut self) -> ReflectMut<'_>
fn reflect_mut(&mut self) -> ReflectMut<'_>
§fn reflect_owned(self: Box<ZIndex, Global>) -> ReflectOwned
fn reflect_owned(self: Box<ZIndex, Global>) -> ReflectOwned
§fn reflect_hash(&self) -> Option<u64>
fn reflect_hash(&self) -> Option<u64>
§fn reflect_partial_eq(&self, value: &(dyn Reflect + 'static)) -> Option<bool>
fn reflect_partial_eq(&self, value: &(dyn Reflect + 'static)) -> Option<bool>
§fn debug(&self, f: &mut Formatter<'_>) -> Result<(), Error>
fn debug(&self, f: &mut Formatter<'_>) -> Result<(), Error>
§fn serializable(&self) -> Option<Serializable<'_>>
fn serializable(&self) -> Option<Serializable<'_>>
§impl Typed for ZIndexwhere
i32: FromReflect,
impl Typed for ZIndexwhere i32: FromReflect,
impl Copy for ZIndex
Auto Trait Implementations§
impl RefUnwindSafe for ZIndex
impl Send for ZIndex
impl Sync for ZIndex
impl Unpin for ZIndex
impl UnwindSafe for ZIndex
Blanket Implementations§
§impl<T, U> AsBindGroupShaderType<U> for Twhere
U: ShaderType,
&'a T: for<'a> Into<U>,
impl<T, U> AsBindGroupShaderType<U> for Twhere U: ShaderType, &'a T: for<'a> Into<U>,
§fn as_bind_group_shader_type(&self, _images: &RenderAssets<Image>) -> U
fn as_bind_group_shader_type(&self, _images: &RenderAssets<Image>) -> U
T
ShaderType
for self
. When used in AsBindGroup
derives, it is safe to assume that all images in self
exist.§impl<C> Bundle for Cwhere
C: Component,
impl<C> Bundle for Cwhere C: Component,
fn component_ids( components: &mut Components, storages: &mut Storages, ids: &mut impl FnMut(ComponentId) )
unsafe fn from_components<T, F>(ctx: &mut T, func: &mut F) -> Cwhere F: for<'a> FnMut(&'a mut T) -> OwningPtr<'a, Aligned>,
fn get_components( self, func: &mut impl FnMut(StorageType, OwningPtr<'_, Aligned>) )
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere T: Any,
§fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere T: Default,
§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Self
using data from the given World§impl<T> GetPath for Twhere
T: Reflect,
impl<T> GetPath for Twhere T: Reflect,
§fn reflect_path<'r, 'p>(
&'r self,
path: &'p str
) -> Result<&'r (dyn Reflect + 'static), ReflectPathError<'p>>
fn reflect_path<'r, 'p>( &'r self, path: &'p str ) -> Result<&'r (dyn Reflect + 'static), ReflectPathError<'p>>
path
. Read more§fn reflect_path_mut<'r, 'p>(
&'r mut self,
path: &'p str
) -> Result<&'r mut (dyn Reflect + 'static), ReflectPathError<'p>>
fn reflect_path_mut<'r, 'p>( &'r mut self, path: &'p str ) -> Result<&'r mut (dyn Reflect + 'static), ReflectPathError<'p>>
path
. Read more