Class UILabel

All Implemented Interfaces:
LXLoopTask
Direct Known Subclasses:
UIComponentLabel, UILabel.Control, UILabel.Copyable, UIParameterLabel

public class UILabel extends UI2dComponent
A simple text label object. Draws a string aligned top-left to its x-y position.
  • Field Details

  • Constructor Details

    • UILabel

      public UILabel()
    • UILabel

      public UILabel(float w, String label)
    • UILabel

      public UILabel(float w, float h, String label)
    • UILabel

      public UILabel(float x, float y, float w, String label)
    • UILabel

      public UILabel(float x, float y, float w, float h)
    • UILabel

      public UILabel(float x, float y, float w, float h, String label)
  • Method Details

    • setBreakLines

      public UILabel setBreakLines(boolean breakLines)
      Sets the label to render text multi-line
      Parameters:
      breakLines - Whether to break lines
      Returns:
      this
    • setBreakLines

      public UILabel setBreakLines(boolean breakLines, boolean autoHeight)
      Sets the label to render text multi-line
      Parameters:
      breakLines - Whether to break lines
      autoHeight - Whether to automatically set height
      Returns:
      this
    • setPadding

      public UILabel setPadding(int padding)
      Sets padding on all 4 sides
      Parameters:
      padding - Padding
      Returns:
      this
    • setPadding

      public UILabel setPadding(int topBottom, int leftRight)
      Sets padding on top and sides, CSS style
      Parameters:
      topBottom - Top bottom padding
      leftRight - Left right padding
      Returns:
      this
    • setPadding

      public UILabel setPadding(int topPadding, int rightPadding, int bottomPadding, int leftPadding)
      Sets padding on all 4 sides
      Parameters:
      topPadding - Top padding
      rightPadding - Right padding
      bottomPadding - Bottom padding
      leftPadding - Left padding
      Returns:
      this
    • onDraw

      protected void onDraw(UI ui, VGraphics vg)
      Description copied from class: UI2dComponent
      Subclasses should override this method to perform their drawing functions.
      Overrides:
      onDraw in class UI2dComponent
      Parameters:
      ui - UI context
      vg - Graphics context
    • getLabel

      public String getLabel()
    • setLabel

      public UILabel setLabel(String label)
    • getDescription

      public String getDescription()
      Description copied from class: UIObject
      Objects are encouraged to override this method providing a helpful String displayed to the user explaining the function of this UI component. If no help is available, return null rather than an empty String.
      Overrides:
      getDescription in class UIObject
      Returns:
      Helpful contextual string explaining function of this element