[][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 { r: 0.0, g: 0.0, b: 1.0, a: 1.0 });

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<Message, Renderer> Widget<Message, Renderer> for Text where
    Renderer: Renderer
[src]

fn on_event(
    &mut self,
    _event: Event,
    _layout: Layout,
    _cursor_position: Point,
    _messages: &mut Vec<Message>
)
[src]

Processes a runtime [Event]. Read more

impl Clone for Text[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

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

impl Debug for Text[src]

Auto Trait Implementations

impl Send for Text

impl Sync for Text

Blanket Implementations

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

type Owned = T

The resulting type after obtaining ownership.

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

impl<T> From<T> for 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> BorrowMut<T> for T where
    T: ?Sized
[src]

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

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

impl<T> Erased for T

impl<T> SetParameter for T

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

Sets value as a parameter of self.

impl<T> Same<T> for T

type Output = T

Should always be Self

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