Class WidgetLabel

java.lang.Object
app.ui.widgets.Widget
app.ui.widgets.WidgetLabel
All Implemented Interfaces:
IDrawable

public class WidgetLabel extends Widget
WidgetLabel is a UI widget that represents a label. It extends the Widget class.
  • Constructor Details

    • WidgetLabel

      public WidgetLabel(int x, int y, int len, String text)
      Constructs a WidgetLabel with specified position, length, and text.
      Parameters:
      x - The x-coordinate of the label.
      y - The y-coordinate of the label.
      len - The length of the label.
      text - The text displayed on the label.
    • WidgetLabel

      public WidgetLabel(int x, int y, int len, String text, TEXT_ALIGNMENT textAlignment)
      Constructs a WidgetLabel with specified position, length, text, and text alignment.
      Parameters:
      x - The x-coordinate of the label.
      y - The y-coordinate of the label.
      len - The length of the label.
      text - The text displayed on the label.
      textAlignment - The text alignment of the label.
  • Method Details

    • draw

      public void draw(char[][] buffer, com.googlecode.lanterna.TextColor[][] printColor, com.googlecode.lanterna.TextColor[][] backColor)
      Draws the label on the given buffer with specified colors.
      Specified by:
      draw in interface IDrawable
      Specified by:
      draw in class Widget
      Parameters:
      buffer - The character buffer for drawing the label.
      printColor - The colors for the printed characters.
      backColor - The background colors.