# cee::vis::OverlayTextBox

class `OverlayTextBox` : public OverlayItem

  A view overlay item capable of showing a text with optional border and background.

  The overlay item can be added to a view using the View::overlay() and Overlay::addItem(). The view manages the layout of the overlay items, so only a desired size can be given in this class. The position is specified when the overlay item is added to the view.

  An overlay item can be shown in multiple views at the same time.

  See also

  OverlayItem, Overlay, View

  Public Types

  enum `TextBoxContentAlignment`

    Alignment of text content within a text box.

    Values:

    enumerator `LEFT`

      Align left.

    enumerator `CENTER`

      Align center.

    enumerator `RIGHT`

      Align right.

  Public Functions

  `OverlayTextBox`(Font *font)

    Constructs an overlay text box.

  void `setSizeToFitText`()

    Sets the size of the text box to fit the current text.

    The method will also add a bit of space for the border or background if enabled.

  void `setFont`(Font *font)

    Sets the font to use in the text box.

  Str `text`() const

    Returns the text currently displayed in the text box.

  void `setText`(const Str &text)

    Sets the text to show in the text box.

  Color3f `textColor`() const

    Returns the color of the text in the text box.

  void `setTextColor`(const Color3f &color)

    Sets the color of the text in the text box.

  Color3f `backgroundColor`() const

    Returns the background color of the text box.

  void `setBackgroundColor`(const Color3f &color)

    Sets the color of the background of the text box.

  float `backgroundOpacity`() const

    Returns the opacity of the background. 1.0 = opaque, 0.0 = fully transparent.

  void `setBackgroundOpacity`(float opacity)

    Sets the opacity (transparency) of the background of the text box. 1.0 = opaque, 0.0 = fully transparent.

  Color3f `borderColor`() const

    Returns the border color of the text box.

  void `setBorderColor`(const Color3f &color)

    Sets the color of the border of the text box.

  float `borderWidth`() const

    Returns the width of the border around the text box in pixels.

  void `setBorderWidth`(float width)

    Sets the width in pixels of the border around the text box.

  bool `drawBackground`() const

    Returns true if the background is drawn.

  void `setDrawBackground`(bool drawBackground)

    Specifies if the background should be drawn or not.

  bool `drawBorder`() const

    Returns true if the border is drawn.

  void `setDrawBorder`(bool drawBorder)

    Specifies if the border should be drawn or not.

  TextBoxContentAlignment `textContentAlignment`() const

    Returns alignment of text content in text box.

  void `setTextContentAlignment`(TextBoxContentAlignment alignment)

    Sets alignment of text content in text box.

Conversation saved
HOOPSY BETA

### Hello! I'm HOOPSY

Your multilingual generative AI assistant for documentation. Ask me anything about HOOPS Envision for Desktop in your own language, or choose a sample question below to start a conversation:

What is HOOPS Envision for Desktop?
What are the latest release notes for HOOPS Envision for Desktop?
How do I start evaluating HOOPS Envision for Desktop?
How do I write my first sample application?
How can I get assistance?

HOOPSY may store conversations according to OpenAI's policy. Responses may not always be accurate.

HOOPSY is thinking...