pub fn label(&mut self, text: &str, alignment: Option<Alignment>) {
        let (width, height, actual_alignment);

        match alignment {
            Some(alignment) => {
                actual_alignment = alignment;
                width = self.style.comp_width;
                height = self.default_height();
            },
            None => {
                actual_alignment = Alignment::Left;
                width = self.font.font().width(text, self.style.font_size);
                height = self.default_height();
            },
        }

        let size = Vec2::new(width, height);
        let pos = self.caret;

        text_in_quad(&mut self.font, self.style.font_size, pos, size, self.style.padding, 
                     text, actual_alignment, self.style.text_color);
        self.advance_caret(width, height);
    }
/// Inserts the given string into the gui. If an alignment is given the label will have the
/// default component size, and the text in it will be drawn based on that alignment. Returns
/// true if the label is currently hovered.
Inserts the given string into the gui. If an alignment is given the label will have the
default component size, and the text in it will be drawn based on that alignment. Returns
true if the label is currently hovered.
Inserts the given string into the gui . If an alignment is given the label will have the default component size and the text in it will be drawn based on that alignment . Returns true if the label is currently hovered .
pub fn label(&mut self, text: &str, alignment: Option<Alignment>) {
        let (width, height, actual_alignment);
        match alignment {
            Some(alignment) => {
                actual_alignment = alignment;
                width = self.style.comp_width;
                height = self.default_height();
            },
            None => {
                actual_alignment = Alignment::Left;
                width = self.font.font().width(text, self.style.font_size);
                height = self.default_height();
            },
        }
        let size = Vec2::new(width, height);
        let pos = self.caret;
        text_in_quad(&mut self.font, self.style.font_size, pos, size, self.style.padding, 
                     text, actual_alignment, self.style.text_color);
        self.advance_caret(width, height);
    }
pub fn label ( & mut self , text : & str , alignment : Option < Alignment > ) { let ( width , height , actual_alignment ) ; match alignment { Some ( alignment ) => { actual_alignment = alignment ; width = self . style . comp_width ; height = self . default_height ( ) ; } , None => { actual_alignment = Alignment :: Left ; width = self . font . font ( ) . width ( text , self . style . font_size ) ; height = self . default_height ( ) ; } , } let size = Vec2 :: new ( width , height ) ; let pos = self . caret ; text_in_quad ( & mut self . font , self . style . font_size , pos , size , self . style . padding , text , actual_alignment , self . style . text_color ) ; self . advance_caret ( width , height ) ; }
Inserts the given string into the gui.
Inserts the given string into the gui .
&mut self
text
&str
alignment
Option<Alignment>
&mut self
text
&str
alignment
Option<Alignment>