pub struct UiStack {
pub direction: StackDirection,
pub flipped: bool,
pub inverted: bool,
pub gap: UiValue<Vec2>,
pub margin: StackMargin,
}Expand description
Ui stack - A type used to define how should subnodes be placed within this node.
ยง๐ ๏ธ Example
let stack: UiStack = UiStack::new().flipped(true);Fieldsยง
ยงdirection: StackDirectionPopulating direction
flipped: boolPopulating direction (flip around y axis) - top-to-bottom vs bottom-to-top.
inverted: boolPopulating direction (flip around x axis) - left-to-right vs right-to-left.
gap: UiValue<Vec2>Minimal gap between subnodes.
margin: StackMarginThe margin that subnodes should inherit.
Implementationsยง
Sourceยงimpl UiStack
impl UiStack
Sourcepub fn direction(self, direction: StackDirection) -> Self
pub fn direction(self, direction: StackDirection) -> Self
Replaces the direction with a new value.
Sourcepub fn gap_x(self, gap: impl Into<UiValue<f32>>) -> Self
pub fn gap_x(self, gap: impl Into<UiValue<f32>>) -> Self
Replaces the horizontal gap with a new value.
Sourcepub fn gap_y(self, gap: impl Into<UiValue<f32>>) -> Self
pub fn gap_y(self, gap: impl Into<UiValue<f32>>) -> Self
Replaces the vertical gap with a new value.
Sourcepub fn margin(self, margin: StackMargin) -> Self
pub fn margin(self, margin: StackMargin) -> Self
Replaces the margin with a new value.
Sourcepub fn set_direction(&mut self, direction: StackDirection)
pub fn set_direction(&mut self, direction: StackDirection)
Sets the direction to a new value.
Sourcepub fn set_flipped(&mut self, value: bool)
pub fn set_flipped(&mut self, value: bool)
Sets the flipped value to a new value.
Sourcepub fn set_inverted(&mut self, value: bool)
pub fn set_inverted(&mut self, value: bool)
Sets the inversion value with a new value.
Sourcepub fn set_gap_x(&mut self, gap: impl Into<UiValue<f32>>)
pub fn set_gap_x(&mut self, gap: impl Into<UiValue<f32>>)
Sets the horizontal gap to a new value.
Sourcepub fn set_gap_y(&mut self, gap: impl Into<UiValue<f32>>)
pub fn set_gap_y(&mut self, gap: impl Into<UiValue<f32>>)
Sets the vertical gap to a new value.
Sourcepub fn set_margin(&mut self, margin: StackMargin)
pub fn set_margin(&mut self, margin: StackMargin)
Sets the margin to a new value.
Trait Implementationsยง
Sourceยงimpl Component for UiStack
impl Component for UiStack
Sourceยงconst STORAGE_TYPE: StorageType = bevy::ecs::component::StorageType::Table
const STORAGE_TYPE: StorageType = bevy::ecs::component::StorageType::Table
A constant indicating the storage type used for this component.
Sourceยงfn register_component_hooks(_hooks: &mut ComponentHooks)
fn register_component_hooks(_hooks: &mut ComponentHooks)
Called when registering this component, allowing mutable access to its
ComponentHooks.impl StructuralPartialEq for UiStack
Auto Trait Implementationsยง
impl Freeze for UiStack
impl RefUnwindSafe for UiStack
impl Send for UiStack
impl Sync for UiStack
impl Unpin for UiStack
impl UnwindSafe for UiStack
Blanket Implementationsยง
Sourceยงimpl<T, U> AsBindGroupShaderType<U> for T
impl<T, U> AsBindGroupShaderType<U> for T
Sourceยงfn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U
fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U
Return the
T ShaderType for self. When used in AsBindGroup
derives, it is safe to assume that all images in self exist.ยงimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
ยงfn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Sourceยง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) -> C
Sourceยงfn get_component_ids(
components: &Components,
ids: &mut impl FnMut(Option<ComponentId>),
)
fn get_component_ids( components: &Components, ids: &mut impl FnMut(Option<ComponentId>), )
ยงimpl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
ยงunsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
๐ฌThis is a nightly-only experimental API. (
clone_to_uninit)Sourceยงimpl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Sourceยงfn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
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.Sourceยงfn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Sourceยงfn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Anyโs vtable from &Traitโs.Sourceยงfn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Anyโs vtable from &mut Traitโs.Sourceยงimpl<T> DowncastSync for T
impl<T> DowncastSync for T
Sourceยงimpl<C> DynamicBundle for Cwhere
C: Component,
impl<C> DynamicBundle for Cwhere
C: Component,
fn get_components(self, func: &mut impl FnMut(StorageType, OwningPtr<'_>))
Sourceยงimpl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
Sourceยงfn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Creates
Self using data from the given World.