Class AnnotatedOverlay

java.lang.Object
dev.twilite.client.ui.overlay.AnnotatedOverlay
All Implemented Interfaces:
Overlay, StackedOverlay, OverlayBinding

public class AnnotatedOverlay extends Object implements Overlay, StackedOverlay
Reflection-backed overlay for classes annotated with OverlayPanel.
  • Constructor Details

    • AnnotatedOverlay

      public AnnotatedOverlay(Object target)
      Creates an overlay wrapper for an annotated object.
    • AnnotatedOverlay

      public AnnotatedOverlay(Object target, PluginDescriptor descriptor)
      Creates an overlay wrapper for an annotated object owned by a plugin.
    • AnnotatedOverlay

      public AnnotatedOverlay(Object target, PluginDescriptor descriptor, dev.twilite.client.ui.OverlayRenderSettings renderSettings)
      Creates an overlay wrapper for an annotated object owned by a plugin.
  • Method Details

    • supports

      public static boolean supports(Class<?> type)
      Returns whether a type can be rendered by this overlay wrapper.
    • imgui

      public boolean imgui()
      Description copied from interface: OverlayBinding
      Returns whether annotation-backed panel rows should render through native ImGui.

      World geometry overlays still render through Java2D. Override this when an overlay needs to force a renderer. If left inherited, the Overlay plugin config controls the effective default.

      Specified by:
      imgui in interface OverlayBinding
    • paint

      public void paint(Graphics2D graphics, int width, int height)
      Description copied from interface: Overlay
      Paints this overlay.
      Specified by:
      paint in interface Overlay
      Parameters:
      graphics - graphics context for the current frame
      width - canvas width in pixels
      height - canvas height in pixels
    • position

      public OverlayPosition position()
      Specified by:
      position in interface StackedOverlay
    • size

      public Dimension size(Graphics2D graphics, int canvasWidth, int canvasHeight)
      Specified by:
      size in interface StackedOverlay
    • panelSize

      public Dimension panelSize(Graphics2D graphics)
    • paint

      public void paint(Graphics2D graphics, int width, int height, int stackOffset)
      Specified by:
      paint in interface StackedOverlay
    • mousePressed

      public boolean mousePressed(int x, int y)
      Specified by:
      mousePressed in interface StackedOverlay
    • mouseReleased

      public boolean mouseReleased(int x, int y)
      Specified by:
      mouseReleased in interface StackedOverlay
    • mouseMoved

      public boolean mouseMoved(int x, int y)
      Specified by:
      mouseMoved in interface StackedOverlay
    • mouseWheel

      public boolean mouseWheel(int x, int y, int wheelDelta)
      Specified by:
      mouseWheel in interface StackedOverlay
    • buildImGuiOverlay

      public void buildImGuiOverlay(ImGuiOverlay overlay)
    • buildImGuiOverlay

      public void buildImGuiOverlay(ImGuiOverlay overlay, int stackOffset)