Package net.runelite.client.ui.overlay
Class Overlay
- java.lang.Object
-
- net.runelite.client.ui.overlay.Overlay
-
- All Implemented Interfaces:
LayoutableRenderableEntity
,RenderableEntity
- Direct Known Subclasses:
BlastMineRockOverlay
,ClueScrollWorldOverlay
,FpsOverlay
,GroundItemsOverlay
,GroundMarkerOverlay
,ItemStatOverlay
,MTASceneOverlay
,OverlayPanel
,PestControlOverlay
,PlayerIndicatorsMinimapOverlay
,PlayerIndicatorsOverlay
,PlayerIndicatorsTileOverlay
,PohOverlay
,PuzzleSolverOverlay
,SceneOverlay
,ScreenMarkerOverlay
,TileIndicatorsOverlay
,TitheFarmPlantOverlay
,TooltipOverlay
,TrapOverlay
,WidgetInspectorOverlay
,WidgetItemOverlay
,WidgetOverlay
,WorldMapLocationOverlay
,WorldMapOverlay
,XpGlobesOverlay
public abstract class Overlay extends Object implements LayoutableRenderableEntity
-
-
Field Summary
Fields Modifier and Type Field Description static float
PRIORITY_DEFAULT
static float
PRIORITY_HIGH
static float
PRIORITY_HIGHEST
static float
PRIORITY_LOW
static float
PRIORITY_MED
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description OverlayMenuEntry
addMenuEntry(MenuAction action, String option, String target)
OverlayMenuEntry
addMenuEntry(MenuAction action, String option, String target, Consumer<MenuEntry> callback)
protected void
drawAfterInterface(int interfaceId)
Configure to draw this overlay after the given interface is drawn.protected void
drawAfterLayer(int component)
Configure to draw this overlay after the given layer is drawn.protected void
drawAfterLayer(int groupId, int childId)
Configure to draw this overlay after the given layer is drawn.protected void
drawAfterLayer(WidgetInfo layer)
Deprecated.Rectangle
getBounds()
List<Integer>
getDrawHooks()
OverlayLayer
getLayer()
List<OverlayMenuEntry>
getMenuEntries()
int
getMinimumSize()
String
getName()
Overlay name, used for saving the overlay, needs to be uniqueRectangle
getParentBounds()
Get the parent bounds for overlay dragging.Plugin
getPlugin()
OverlayPosition
getPosition()
Point
getPreferredLocation()
OverlayPosition
getPreferredPosition()
Dimension
getPreferredSize()
float
getPriority()
The overlay priority, which determines the order the overlay renders in relative to other overlays.boolean
isDragTargetable()
Whether this overlay can be dragged onto other overlays & have other overlays dragged onto it.boolean
isMovable()
Whether this overlay can be moved with altboolean
isResettable()
boolean
isResizable()
boolean
isSnappable()
Whether this overlay can be moved to a snap corner and have its preferredPosition changedboolean
onDrag(Overlay other)
Called when an overlay is dragged onto this, if dragTargetable is true.void
onMouseOver()
void
removeMenuEntry(MenuAction action, String option, String target)
void
revalidate()
void
setBounds(Rectangle bounds)
protected void
setDragTargetable(boolean dragTargetable)
Whether this overlay can be dragged onto other overlays & have other overlays dragged onto it.void
setLayer(OverlayLayer layer)
void
setMinimumSize(int minimumSize)
protected void
setMovable(boolean movable)
Whether this overlay can be moved with altvoid
setPosition(OverlayPosition position)
void
setPreferredLocation(Point preferredLocation)
void
setPreferredPosition(OverlayPosition preferredPosition)
void
setPreferredSize(Dimension preferredSize)
void
setPriority(float priority)
void
setPriority(OverlayPriority overlayPriority)
void
setResettable(boolean resettable)
void
setResizable(boolean resizable)
protected void
setSnappable(boolean snappable)
Whether this overlay can be moved to a snap corner and have its preferredPosition changed-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.runelite.client.ui.overlay.RenderableEntity
render
-
-
-
-
Field Detail
-
PRIORITY_LOW
public static final float PRIORITY_LOW
- See Also:
- Constant Field Values
-
PRIORITY_DEFAULT
public static final float PRIORITY_DEFAULT
- See Also:
- Constant Field Values
-
PRIORITY_MED
public static final float PRIORITY_MED
- See Also:
- Constant Field Values
-
PRIORITY_HIGH
public static final float PRIORITY_HIGH
- See Also:
- Constant Field Values
-
PRIORITY_HIGHEST
public static final float PRIORITY_HIGHEST
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Overlay
protected Overlay()
-
Overlay
protected Overlay(@Nullable Plugin plugin)
-
-
Method Detail
-
setPriority
public void setPriority(float priority)
-
setPriority
public void setPriority(OverlayPriority overlayPriority)
-
getName
public String getName()
Overlay name, used for saving the overlay, needs to be unique- Returns:
- overlay name
-
drawAfterInterface
protected void drawAfterInterface(@Interface int interfaceId)
Configure to draw this overlay after the given interface is drawn. Except in rare circumstances, you probably also want tosetLayer(OverlayLayer)
toOverlayLayer.MANUAL
to avoid the overlay being drawn a 2nd time during the defaultOverlayLayer.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 tosetLayer(OverlayLayer)
toOverlayLayer.MANUAL
to avoid the overlay being drawn a 2nd time during the defaultOverlayLayer.UNDER_WIDGETS
pass. The layer must be a widget ofWidgetType
WidgetType.LAYER
- Parameters:
groupId
- The widget group idchildId
- The widget child id- See Also:
WidgetID
-
drawAfterLayer
@Deprecated protected void drawAfterLayer(WidgetInfo layer)
Deprecated.Configure to draw this overlay after the given layer is drawn. Except in rare circumstances, you probably also want tosetLayer(OverlayLayer)
toOverlayLayer.MANUAL
to avoid the overlay being drawn a 2nd time during the defaultOverlayLayer.UNDER_WIDGETS
pass. The layer must be a widget ofWidgetType
WidgetType.LAYER
- Parameters:
layer
- The layer- See Also:
WidgetInfo
-
drawAfterLayer
protected void drawAfterLayer(@Component int component)
Configure to draw this overlay after the given layer is drawn. Except in rare circumstances, you probably also want tosetLayer(OverlayLayer)
toOverlayLayer.MANUAL
to avoid the overlay being drawn a 2nd time during the defaultOverlayLayer.UNDER_WIDGETS
pass. The layer must be a widget ofWidgetType
WidgetType.LAYER
- Parameters:
component
- 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 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()
-
setPosition
public void setPosition(OverlayPosition position)
-
addMenuEntry
public OverlayMenuEntry addMenuEntry(MenuAction action, String option, String target)
-
addMenuEntry
public OverlayMenuEntry addMenuEntry(MenuAction action, String option, String target, Consumer<MenuEntry> callback)
-
removeMenuEntry
public void removeMenuEntry(MenuAction action, String option, String target)
-
getPlugin
@Nullable public Plugin getPlugin()
-
getPreferredLocation
public Point getPreferredLocation()
-
getPreferredSize
public Dimension getPreferredSize()
-
getPreferredPosition
public OverlayPosition getPreferredPosition()
-
getBounds
public Rectangle getBounds()
- Specified by:
getBounds
in interfaceLayoutableRenderableEntity
-
getPosition
public OverlayPosition getPosition()
-
getPriority
public float getPriority()
The overlay priority, which determines the order the overlay renders in relative to other overlays.
-
getLayer
public OverlayLayer getLayer()
-
getMenuEntries
public List<OverlayMenuEntry> getMenuEntries()
-
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
-
setPreferredLocation
public void setPreferredLocation(Point preferredLocation)
- Specified by:
setPreferredLocation
in interfaceLayoutableRenderableEntity
-
setPreferredSize
public void setPreferredSize(Dimension preferredSize)
- Specified by:
setPreferredSize
in interfaceLayoutableRenderableEntity
-
setPreferredPosition
public void setPreferredPosition(OverlayPosition preferredPosition)
-
setBounds
public void setBounds(Rectangle bounds)
-
setLayer
public void setLayer(OverlayLayer layer)
-
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
-
-