Class PrivBotChatboxOverlayComponents
java.lang.Object
privbot.ui.overlay.PrivBotChatboxOverlayComponents
Shared drawing helpers for PrivBot-branded chatbox overlays.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidTurns on antialiasing, LCD text antialiasing and quality rendering forg.static StringclipToWidth(Graphics2D g, String text, int maxWidth) textcut to fitmaxWidthin the value font, ending in"..."when cut; null gives"-".static intdrawBrandHeader(Graphics2D g, String title, String subtitle, int x, int y) drawBrandHeader(Graphics2D, String, String, int, int, Image)without an icon.static intdrawBrandHeader(Graphics2D g, String title, String subtitle, int x, int y, Image icon) Draws a branded header with optional plugin icon.static intdrawBrandHeader(Graphics2D g, String title, String subtitle, int x, int y, Image icon, int iconSize) Same asdrawBrandHeader(Graphics2D, String, String, int, int, Image)but allows a customiconSizewheniconis non-null.static intdrawCenteredDualIconHeader(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.static intdrawKeyValue(Graphics2D g, String key, String value, int x, int y, int width, Color valueColor) Drawskey:and its value on one baseline, the value clipped with an ellipsis to fit.static intdrawKeyValueWrapped(Graphics2D g, String key, String value, int x, int y, int width, Color valueColor, int maxLines) LikedrawKeyValue(java.awt.Graphics2D, java.lang.String, java.lang.String, int, int, int, java.awt.Color)but word-wraps the value over up tomaxLineslines.static voidpaintCardBackground(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.wrapToWidth(Graphics2D g, String text, int maxWidth, int maxLines) Word-wrapstexttomaxWidthin the value font, at mostmaxLineslines; empty gives["-"].
-
Method Details
-
applyQualityRendering
Turns on antialiasing, LCD text antialiasing and quality rendering forg. -
paintCardBackground
Paints the branded dark card (gradient, cyan/orange glow, border, corner accents) at the given bounds. -
drawBrandHeader
drawBrandHeader(Graphics2D, String, String, int, int, Image)without an icon. -
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. Wheniconis 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 asdrawBrandHeader(Graphics2D, String, String, int, int, Image)but allows a customiconSizewheniconis non-null. IficonSizeis <= 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 cardy- top of headerwidth- 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) Drawskey: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) LikedrawKeyValue(java.awt.Graphics2D, java.lang.String, java.lang.String, int, int, int, java.awt.Color)but word-wraps the value over up tomaxLineslines.- Returns:
- the next baseline below the last line
-
clipToWidth
textcut to fitmaxWidthin the value font, ending in"..."when cut; null gives"-". -
wrapToWidth
Word-wrapstexttomaxWidthin the value font, at mostmaxLineslines; empty gives["-"].
-