Class PrivBotChatboxOverlayComponents

java.lang.Object
privbot.ui.overlay.PrivBotChatboxOverlayComponents

public final class PrivBotChatboxOverlayComponents extends Object
Shared drawing helpers for PrivBot-branded chatbox overlays.
  • Method Details

    • applyQualityRendering

      public static void applyQualityRendering(Graphics2D g)
      Turns on antialiasing, LCD text antialiasing and quality rendering for g.
    • paintCardBackground

      public static void paintCardBackground(Graphics2D g, int x, int y, int w, int h)
      Paints the branded dark card (gradient, cyan/orange glow, border, corner accents) at the given bounds.
    • drawBrandHeader

      public static int drawBrandHeader(Graphics2D g, String title, String subtitle, int x, int y)
    • drawBrandHeader

      public static int drawBrandHeader(Graphics2D g, String title, String subtitle, int x, int y, Image icon)
      Draws a branded header with optional plugin icon. When icon is non-null, it is drawn inside the card with title/subtitle to the right. Use the 6-argument overload to pass a custom icon size (e.g. 48 for a smaller icon).
      Returns:
      The y position below the header (for layout: band and content should start below this).
    • drawBrandHeader

      public static int drawBrandHeader(Graphics2D g, String title, String subtitle, int x, int y, Image icon, int iconSize)
      Same as drawBrandHeader(Graphics2D, String, String, int, int, Image) but allows a custom iconSize when icon is non-null. If iconSize is <= 0, defaults to 80.
    • drawCenteredDualIconHeader

      public static int drawCenteredDualIconHeader(Graphics2D g, String title, int x, int y, int width, Image icon, int iconSize)
      Draws a centered header with the same icon on left and right of the title. Use for overlays that want a symmetric header (e.g. Auto Slayer).
      Parameters:
      x - left edge of the card
      y - top of header
      width - full card width (icons and title are laid out within this)
      Returns:
      The y position below the header (y + iconSize).
    • drawKeyValue

      public static int drawKeyValue(Graphics2D g, String key, String value, int x, int y, int width, Color valueColor)
      Draws key: and its value on one baseline, the value clipped with an ellipsis to fit. Blank values draw "-".
      Returns:
      the next baseline (16 px lower)
    • drawKeyValueWrapped

      public static int drawKeyValueWrapped(Graphics2D g, String key, String value, int x, int y, int width, Color valueColor, int maxLines)
      Returns:
      the next baseline below the last line
    • clipToWidth

      public static String clipToWidth(Graphics2D g, String text, int maxWidth)
      text cut to fit maxWidth in the value font, ending in "..." when cut; null gives "-".
    • wrapToWidth

      public static List<String> wrapToWidth(Graphics2D g, String text, int maxWidth, int maxLines)
      Word-wraps text to maxWidth in the value font, at most maxLines lines; empty gives ["-"].