[][src]Struct amethyst_ui::UiLabelBuilder

pub struct UiLabelBuilder<I = u32> where
    I: WidgetId
{ /* fields omitted */ }

Convenience structure for building a label

Methods

impl<'a, I> UiLabelBuilder<I> where
    I: WidgetId + 'static, 
[src]

pub fn new<S: ToString>(text: S) -> UiLabelBuilder<I>[src]

Construct a new UiLabelBuilder. This allows the user to easily build a UI element with a text that can easily be retrieved and updated through the appropriate resource, see Widgets.

pub fn with_id(self, id: I) -> Self[src]

Sets an ID for this widget. The type of this ID will determine which Widgets resource this widget will be added to, see Widgets.

pub fn with_size(self, width: f32, height: f32) -> Self[src]

Set button size

pub fn with_position(self, x: f32, y: f32) -> Self[src]

This will create a default UiTransform if one is not already attached. See DEFAULT_Z, DEFAULT_WIDTH, DEFAULT_HEIGHT, and DEFAULT_TAB_ORDER for the values that will be provided to the default UiTransform.

pub fn with_anchor(self, anchor: Anchor) -> Self[src]

Add an anchor to the button.

pub fn with_stretch(self, stretch: Stretch) -> Self[src]

Stretch the button.

pub fn with_text<S>(self, text: S) -> Self where
    S: ToString
[src]

This will set the rendered characters within the button. Use this to just change what characters will appear. If you need to change the font size, color, etc., then you should use with_uitext and provide a new UiText object.

pub fn with_text_color(self, text_color: [f32; 4]) -> Self[src]

Set text color

pub fn with_font(self, font: FontHandle) -> Self[src]

Use a different font for the button text.

pub fn with_font_size(self, size: f32) -> Self[src]

Set font size

pub fn with_parent(self, parent: Entity) -> Self[src]

Add a parent to the button.

pub fn build(self, res: UiLabelBuilderResources<'a, I>) -> (I, UiLabel)[src]

Build this with the UiLabelBuilderResources.

pub fn build_from_world(self, world: &World) -> (I, UiLabel)[src]

Create the UiLabel based on provided configuration parameters.

Trait Implementations

impl<'a, I> Default for UiLabelBuilder<I> where
    I: WidgetId + 'static, 
[src]

impl<I: Debug> Debug for UiLabelBuilder<I> where
    I: WidgetId
[src]

Auto Trait Implementations

impl<I> Unpin for UiLabelBuilder<I> where
    I: Unpin

impl<I> Sync for UiLabelBuilder<I>

impl<I> Send for UiLabelBuilder<I>

impl<I> UnwindSafe for UiLabelBuilder<I> where
    I: UnwindSafe

impl<I> RefUnwindSafe for UiLabelBuilder<I> where
    I: RefUnwindSafe

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Same<T> for T[src]

type Output = T

Should always be Self

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 
[src]

impl<T> Resource for T where
    T: Any + Send + Sync
[src]

impl<T> Any for T where
    T: Any
[src]

impl<T> TryDefault for T where
    T: Default
[src]

fn unwrap_default() -> Self[src]

Calls try_default and panics on an error case.

impl<T> Event for T where
    T: Send + Sync + 'static, 
[src]

impl<T> Erased for T[src]

impl<T> SetParameter for T[src]

fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
    T: Parameter<Self>, 
[src]

Sets value as a parameter of self.

impl<T> Supports<T> for T[src]

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
    D: AdaptFrom<S, Swp, Dwp, T>,
    Dwp: WhitePoint,
    Swp: WhitePoint,
    T: Component + Float
[src]

fn adapt_into(self) -> D[src]

Convert the source color to the destination color using the bradford method by default Read more

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 
[src]