Class Overlay

    • Constructor Detail

      • Overlay

        protected Overlay()
      • Overlay

        protected Overlay​(@Nullable
                          Plugin plugin)
    • Method Detail

      • getName

        public java.lang.String getName()
        Overlay name, used for saving the overlay, needs to be unique
        Returns:
        overlay name
      • drawAfterInterface

        protected void drawAfterInterface​(int interfaceId)
        Configure to draw this overlay after the given interface is drawn. Except in rare circumstances, you probably also want to setLayer(OverlayLayer) to OverlayLayer.MANUAL to avoid the overlay being drawn a 2nd time during the default OverlayLayer.UNDER_WIDGETS pass.
        Parameters:
        interfaceId - The interface id
        See Also:
        WidgetID
      • drawAfterLayer

        protected void drawAfterLayer​(int groupId,
                                      int childId)
        Configure to draw this overlay after the given layer is drawn. Except in rare circumstances, you probably also want to setLayer(OverlayLayer) to OverlayLayer.MANUAL to avoid the overlay being drawn a 2nd time during the default OverlayLayer.UNDER_WIDGETS pass. The layer must be a widget of WidgetType WidgetType.LAYER
        Parameters:
        groupId - The widget group id
        childId - The widget child id
        See Also:
        WidgetID
      • drawAfterLayer

        protected void drawAfterLayer​(net.runelite.api.widgets.WidgetInfo layer)
        Configure to draw this overlay after the given layer is drawn. Except in rare circumstances, you probably also want to setLayer(OverlayLayer) to OverlayLayer.MANUAL to avoid the overlay being drawn a 2nd time during the default OverlayLayer.UNDER_WIDGETS pass. The layer must be a widget of WidgetType WidgetType.LAYER
        Parameters:
        layer - The layer
        See Also:
        WidgetInfo
      • onMouseOver

        public void onMouseOver()
      • onDrag

        public boolean onDrag​(Overlay other)
        Called when an overlay is dragged onto this, if dragTargetable is true. Return true to consume the mouse event and prevent the other overlay from being moved
        Parameters:
        other - the overlay being dragged
        Returns:
      • getParentBounds

        @Nullable
        public java.awt.Rectangle getParentBounds()
        Get the parent bounds for overlay dragging. The overlay will not be allowed to be moved outside of the parent bounds.
        Returns:
      • revalidate

        public void revalidate()
      • getPlugin

        @Nullable
        public Plugin getPlugin()
      • getPreferredLocation

        public java.awt.Point getPreferredLocation()
      • getPreferredSize

        public java.awt.Dimension getPreferredSize()
      • getDrawHooks

        public java.util.List<java.lang.Integer> getDrawHooks()
      • isResizable

        public boolean isResizable()
      • getMinimumSize

        public int getMinimumSize()
      • isResettable

        public boolean isResettable()
      • isDragTargetable

        public boolean isDragTargetable()
        Whether this overlay can be dragged onto other overlays & have other overlays dragged onto it.
      • isMovable

        public boolean isMovable()
        Whether this overlay can be moved with alt
      • isSnappable

        public boolean isSnappable()
        Whether this overlay can be moved to a snap corner and have its preferredPosition changed
      • setPreferredPosition

        public void setPreferredPosition​(OverlayPosition preferredPosition)
      • setBounds

        public void setBounds​(java.awt.Rectangle bounds)
      • setResizable

        public void setResizable​(boolean resizable)
      • setMinimumSize

        public void setMinimumSize​(int minimumSize)
      • setResettable

        public void setResettable​(boolean resettable)
      • setDragTargetable

        protected void setDragTargetable​(boolean dragTargetable)
        Whether this overlay can be dragged onto other overlays & have other overlays dragged onto it.
      • setMovable

        protected void setMovable​(boolean movable)
        Whether this overlay can be moved with alt
      • setSnappable

        protected void setSnappable​(boolean snappable)
        Whether this overlay can be moved to a snap corner and have its preferredPosition changed