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. When Widget::setFixedWidth() is used, the text is wrapped when it surpasses the specified width.
Public Functions
-
Label
(Widget *parent, const std::string &caption, const std::string &font = "sans", int fontSize = -1)¶
Get the label’s text caption.
-
void
setCaption
(const std::string &caption)¶ Set the label’s text caption.
-
void
setFont
(const std::string &font)¶ Set the currently active font (2 are available by default: ‘sans’ and ‘sans-bold’)
-
const std::string &
font
() const¶ Get the currently active font.
-
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¶ Save the state of the widget into the given Serializer instance.
-
virtual bool
load
(Serializer &s)¶ Restore the state of the widget from the given Serializer instance.
-