Class LabelWidget

java.lang.Object
com.avrix.ui.widgets.Widget
com.avrix.ui.widgets.LabelWidget

public class LabelWidget extends Widget
A Widget for displaying text labels with customizable font and color.
  • Constructor Details

    • LabelWidget

      public LabelWidget(String text, String fontName, int x, int y, int width, int fontSize, NanoColor textColor)
      Constructs a new LabelWidget with the specified text, font, position, size, and color.
      Parameters:
      text - the text to display
      fontName - the name of the font to use
      x - the x-coordinate of the Widget's position
      y - the y-coordinate of the Widget's position
      width - the width of the Widget's position
      fontSize - the size of the font
      textColor - the color of the text
  • Method Details

    • getFontSize

      public int getFontSize()
      Gets the font size of the text.
      Returns:
      the font size
    • setFontSize

      public void setFontSize(int fontSize)
      Sets the font size of the text.
      Parameters:
      fontSize - the new font size
    • getTextColor

      public final NanoColor getTextColor()
      Gets the color of the text.
      Returns:
      the text color
    • setTextColor

      public final void setTextColor(NanoColor textColor)
      Sets the color of the text.
      Parameters:
      textColor - the new text color
    • getText

      public final String getText()
      Gets the text displayed by the widget.
      Returns:
      the text
    • setText

      public final void setText(String text)
      Sets the text to be displayed by the Widget.
      Parameters:
      text - the new text
    • getFontName

      public final String getFontName()
      Gets the name of the font used by the Widget.
      Returns:
      the font name
    • setFontName

      public final void setFontName(String fontName)
      Sets the name of the font to be used by the Widget.
      Parameters:
      fontName - the new font name
    • update

      public void update()
      Updates the Widget
      Overrides:
      update in class Widget
    • render

      public void render()
      Renders the Widget
      Specified by:
      render in class Widget