pub fn label_hover(&mut self, text: &str, alignment: Option<Alignment>) -> bool {
        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;

        let hovered = self.mouse_pos.x > pos.x && self.mouse_pos.y > pos.y && 
            self.mouse_pos.x < pos.x + width && self.mouse_pos.y < pos.y + height;

        let color = if hovered { self.style.text_color_hovered } else { self.style.text_color };

        text_in_quad(&mut self.font, self.style.font_size, pos, size, self.style.padding, 
                     text, actual_alignment, color);
        self.advance_caret(width, height);

        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. This
/// label differs from the normal label in that it can be hovered, and will change color if 
/// hovered. 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. This
label differs from the normal label in that it can be hovered, and will change color if
hovered. 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 . This label differs from the normal label in that it can be hovered and will change color if hovered . Returns true if the label is currently hovered .
pub fn label_hover(&mut self, text: &str, alignment: Option<Alignment>) -> bool {
        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;
        let hovered = self.mouse_pos.x > pos.x && self.mouse_pos.y > pos.y && 
            self.mouse_pos.x < pos.x + width && self.mouse_pos.y < pos.y + height;
        let color = if hovered { self.style.text_color_hovered } else { self.style.text_color };
        text_in_quad(&mut self.font, self.style.font_size, pos, size, self.style.padding, 
                     text, actual_alignment, color);
        self.advance_caret(width, height);
        hovered
    }
pub fn label_hover ( & mut self , text : & str , alignment : Option < Alignment > ) -> bool { 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 ; let hovered = self . mouse_pos . x > pos . x && self . mouse_pos . y > pos . y && self . mouse_pos . x < pos . x + width && self . mouse_pos . y < pos . y + height ; let color = if hovered { self . style . text_color_hovered } else { self . style . text_color } ; text_in_quad ( & mut self . font , self . style . font_size , pos , size , self . style . padding , text , actual_alignment , color ) ; self . advance_caret ( width , height ) ; hovered }
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>