Trait UiBase

Source
pub trait UiBase {
    // Required methods
    fn name_node(&mut self) -> &mut Name;
    fn node_node(&mut self) -> &mut Node;

    // Provided methods
    fn name(self, name: impl Into<Cow<'static, str>>) -> Self
       where Self: Sized { ... }
    fn padding(self, padding: UiRect) -> Self
       where Self: Sized { ... }
    fn frame(self, width: Val, height: Val) -> Self
       where Self: Sized { ... }
    fn width(self, width: Val) -> Self
       where Self: Sized { ... }
    fn height(self, height: Val) -> Self
       where Self: Sized { ... }
}
Expand description

Provides common builder-style methods for UI configuration

Required Methods§

Source

fn name_node(&mut self) -> &mut Name

Returns a mutable reference to the entity’s Name component

Source

fn node_node(&mut self) -> &mut Node

Returns a mutable reference to the entity’s Node component

Provided Methods§

Source

fn name(self, name: impl Into<Cow<'static, str>>) -> Self
where Self: Sized,

Sets the Name component

Source

fn padding(self, padding: UiRect) -> Self
where Self: Sized,

Applies padding to the Node

Source

fn frame(self, width: Val, height: Val) -> Self
where Self: Sized,

Sets width and height of the Node

Source

fn width(self, width: Val) -> Self
where Self: Sized,

Sets the width of the Node

Source

fn height(self, height: Val) -> Self
where Self: Sized,

Sets the height of the Node

Implementors§