pub struct LinearLayout { /* private fields */ }Expand description
A layout that uses a linear algorithm, with optional wrapping
Implementations§
Source§impl LinearLayout
impl LinearLayout
Sourcepub const fn new(axis: Axis) -> Self
pub const fn new(axis: Axis) -> Self
Create a new LinearLayout builder using this Axis
Sourcepub const fn anchor(self, anchor: Anchor2) -> Self
pub const fn anchor(self, anchor: Anchor2) -> Self
Set the anchor for this builder.
An anchor is where the layout starts from
e.g.:
Sourcepub const fn horizontal_anchor(self, anchor: Anchor) -> Self
pub const fn horizontal_anchor(self, anchor: Anchor) -> Self
Set the horizontal anchor for this builder
A horizontal anchor where where on the x axis the layout begins
Sourcepub const fn vertical_anchor(self, anchor: Anchor) -> Self
pub const fn vertical_anchor(self, anchor: Anchor) -> Self
Set the vertical anchor for this builder
A vertical anchor where where on the y axis the layout begins
Sourcepub const fn horizontal() -> Self
pub const fn horizontal() -> Self
Create a default horizontal layout builder
Sourcepub const fn spacing(self, spacing: Vec2) -> Self
pub const fn spacing(self, spacing: Vec2) -> Self
The spacing for the layout.
Spacing is the gap between 2 elements.
spacing.xis the horizontal spacingspacing.yis the vertical spacing
Sourcepub fn layout(self, rect: Rect) -> LinearAllocator
pub fn layout(self, rect: Rect) -> LinearAllocator
Construct the LinearAllocator from this type
This takes in the target Rect that the allocator will fit everything into.
Trait Implementations§
Source§impl Clone for LinearLayout
impl Clone for LinearLayout
Source§fn clone(&self) -> LinearLayout
fn clone(&self) -> LinearLayout
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Default for LinearLayout
The default configuration for a LinearLayout is:
impl Default for LinearLayout
The default configuration for a LinearLayout is:
- horizontal
- no wrapping
- starts at left-top
impl Copy for LinearLayout
Auto Trait Implementations§
impl Freeze for LinearLayout
impl RefUnwindSafe for LinearLayout
impl Send for LinearLayout
impl Sync for LinearLayout
impl Unpin for LinearLayout
impl UnwindSafe for LinearLayout
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