[][src]Struct coffee::ui::widget::text::Text

pub struct Text { /* fields omitted */ }

A fragment of text.

It implements Widget when the associated core::Renderer implements the text::Renderer trait.

Example

use coffee::graphics::Color;
use coffee::ui::Text;

Text::new("I <3 coffee!")
    .size(40)
    .color(Color::BLUE);

Text drawn by the built-in renderer

Methods

impl Text[src]

pub fn new(label: &str) -> Self[src]

Create a new fragment of Text with the given contents.

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

Sets the size of the Text in pixels.

pub fn color(self, color: Color) -> Self[src]

Sets the Color of the Text.

pub fn width(self, width: u32) -> Self[src]

Sets the width of the Text boundaries in pixels.

pub fn height(self, height: u32) -> Self[src]

Sets the height of the Text boundaries in pixels.

pub fn horizontal_alignment(self, alignment: HorizontalAlignment) -> Self[src]

Sets the HorizontalAlignment of the Text.

pub fn vertical_alignment(self, alignment: VerticalAlignment) -> Self[src]

Sets the VerticalAlignment of the Text.

Trait Implementations

impl Clone for Text[src]

impl Debug for Text[src]

impl<'a, Message, Renderer> From<Text> for Element<'a, Message, Renderer> where
    Renderer: Renderer
[src]

impl<Message, Renderer> Widget<Message, Renderer> for Text where
    Renderer: Renderer
[src]

Auto Trait Implementations

impl RefUnwindSafe for Text

impl Send for Text

impl Sync for Text

impl Unpin for Text

impl UnwindSafe for Text

Blanket Implementations

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

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

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

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

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

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> SetParameter for T

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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<V, T> VZip<V> for T where
    V: MultiLane<T>,