Class Label¶
- Defined in File label.h
Page Contents
Inheritance Relationships¶
Base Type¶
public nanogui::Widget(Class Widget)
Class Documentation¶
-
class
Label: public nanogui::Widget¶ Text label widget.
The font and color can be customized.
Tip
When
Widget::setFixedWidthis used, the text is wrapped when it surpasses the specified width.Public Functions
-
Label(Widget *parent, const std::string &caption, const std::string &font = "", int fontSize = -1)¶ Creates a Label with the specified parent.
- Parameters
parent: The parent of this Label.caption: The text this Label will draw.font: The font face to use (default""implies Theme::mDefaultFont, which will typically be"sans").fontSize: The font size to use,-1indicates the default font size specified by Theme::mStandardFontSize will be used.
-
const std::string &
caption() const¶ Get the label’s text caption.
-
void
setCaption(const std::string &caption)¶ Set the label’s text caption.
-
virtual void
setTheme(Theme *theme)¶ Set the Theme used to draw this widget, will change mColor when mColorExplicit is
false(e.g., setColor was never called).
-
virtual Vector2i
preferredSize(NVGcontext *ctx) const¶ Compute the size needed to fully display the label.
-
virtual void
draw(NVGcontext *ctx)¶ Draw the label.
-
virtual void
save(Serializer &s) const¶ Saves the state of this Label provided the given Serializer.
-
virtual bool
load(Serializer &s)¶ Sets the state of this Label provided the given Serializer.
-