pub struct UiNode {
pub width: UiVal,
pub height: UiVal,
pub min_width: UiVal,
pub min_height: UiVal,
pub max_width: UiVal,
pub max_height: UiVal,
pub padding: UiRect<UiVal>,
pub margin: UiRect<UiVal>,
pub flex_direction: UiFlexDirection,
pub flex_grow: f32,
pub flex_shrink: f32,
}Expand description
Represents the layout definition of a UI element. Fully Send/Sync ECS component that is later translated to a layout engine (like taffy) internally.
Fields§
§width: UiValThe width of the UI element.
height: UiValThe height of the UI element.
min_width: UiValThe minimum width of the UI element.
min_height: UiValThe minimum height of the UI element.
max_width: UiValThe maximum width of the UI element.
max_height: UiValThe maximum height of the UI element.
padding: UiRect<UiVal>The padding of the UI element.
margin: UiRect<UiVal>The margin of the UI element.
flex_direction: UiFlexDirectionThe flex direction of the UI element.
flex_grow: f32The flex grow factor of the UI element.
flex_shrink: f32The flex shrink factor of the UI element.
Trait Implementations§
Source§impl Component for UiNode
impl Component for UiNode
Source§fn make_column() -> Box<dyn AnyVec>where
Self: Sized,
fn make_column() -> Box<dyn AnyVec>where
Self: Sized,
Creates this component’s empty storage column. Default: an AoS
Vec<Self>.Source§fn push_into_column(self, column: &mut dyn AnyVec)where
Self: Sized,
fn push_into_column(self, column: &mut dyn AnyVec)where
Self: Sized,
Appends
self as a new row into its column. Read moreSource§fn copy_row_between(src: &dyn AnyVec, src_row: usize, dst: &mut dyn AnyVec)where
Self: Sized,
fn copy_row_between(src: &dyn AnyVec, src_row: usize, dst: &mut dyn AnyVec)where
Self: Sized,
Clones row
src_row from src into dst (used when an entity migrates
between pages on a structural change). Both columns are this component’s
column type. Read moreSource§fn clone_from_column(column: &dyn AnyVec, row: usize) -> Selfwhere
Self: Sized,
fn clone_from_column(column: &dyn AnyVec, row: usize) -> Selfwhere
Self: Sized,
Reads row
row of column as an owned value — the uniform by-value
access path that works for both AoS (clone the &T) and field-SoA
(gather the fields) layouts. Used by World::clone_component, the
Soa<T> query, and the serialization recipe. Read moreimpl StructuralPartialEq for UiNode
Auto Trait Implementations§
impl Freeze for UiNode
impl RefUnwindSafe for UiNode
impl Send for UiNode
impl Sync for UiNode
impl Unpin for UiNode
impl UnsafeUnpin for UiNode
impl UnwindSafe for UiNode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<C1> ComponentBundle for C1where
C1: Component,
impl<C1> ComponentBundle for C1where
C1: Component,
Source§fn type_ids() -> Vec<TypeId>
fn type_ids() -> Vec<TypeId>
Returns the sorted list of
TypeIds for the components in this bundle. Read moreSource§fn create_columns() -> HashMap<TypeId, Box<dyn AnyVec>>
fn create_columns() -> HashMap<TypeId, Box<dyn AnyVec>>
Creates the set of empty, type-erased
Vec<T> columns required to store
this bundle’s components. Read moreSource§fn update_metadata(
metadata: &mut EntityMetadata,
location: PageIndex,
registry: &ComponentRegistry,
)
fn update_metadata( metadata: &mut EntityMetadata, location: PageIndex, registry: &ComponentRegistry, )
Updates the appropriate fields in an
EntityMetadata struct to point
to the location of this bundle’s data. Read moreSource§unsafe fn add_to_page(self, page: &mut ComponentPage)
unsafe fn add_to_page(self, page: &mut ComponentPage)
Adds the components from this bundle into the specified
ComponentPage. Read more