UiText

Trait UiText 

Source
pub trait UiText: Default {
    // Required methods
    fn color(self, color: TextColor) -> Self;
    fn font(self, font: TextFont) -> Self;
    fn text(self, text: Text) -> Self;

    // Provided methods
    fn small(value: &str, font: &Handle<Font>) -> Self { ... }
    fn medium(value: &str, font: &Handle<Font>) -> Self { ... }
    fn large(value: &str, font: &Handle<Font>) -> Self { ... }
    fn extra_large(value: &str, font: &Handle<Font>) -> Self { ... }
}
Expand description

Common interface for the text bundles

Required Methods§

Source

fn color(self, color: TextColor) -> Self

Sets the color of the UiText

Source

fn font(self, font: TextFont) -> Self

Sets the font of the UiText

Source

fn text(self, text: Text) -> Self

Sets the content of the UiText

Provided Methods§

Source

fn small(value: &str, font: &Handle<Font>) -> Self

Create a small text variant

Source

fn medium(value: &str, font: &Handle<Font>) -> Self

Create a medium text variant

Source

fn large(value: &str, font: &Handle<Font>) -> Self

Create a large text variant

Source

fn extra_large(value: &str, font: &Handle<Font>) -> Self

Create a extra large text variant

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§