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 floatPRIORITY_DEFAULTstatic floatPRIORITY_HIGHstatic floatPRIORITY_HIGHESTstatic floatPRIORITY_LOWstatic floatPRIORITY_MED
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description OverlayMenuEntryaddMenuEntry(MenuAction action, String option, String target)OverlayMenuEntryaddMenuEntry(MenuAction action, String option, String target, Consumer<MenuEntry> callback)protected voiddrawAfterInterface(int interfaceId)Configure to draw this overlay after the given interface is drawn.protected voiddrawAfterLayer(int component)Configure to draw this overlay after the given layer is drawn.protected voiddrawAfterLayer(int groupId, int childId)Configure to draw this overlay after the given layer is drawn.protected voiddrawAfterLayer(WidgetInfo layer)Deprecated.RectanglegetBounds()List<Integer>getDrawHooks()OverlayLayergetLayer()List<OverlayMenuEntry>getMenuEntries()intgetMinimumSize()StringgetName()Overlay name, used for saving the overlay, needs to be uniqueRectanglegetParentBounds()Get the parent bounds for overlay dragging.PlugingetPlugin()OverlayPositiongetPosition()PointgetPreferredLocation()OverlayPositiongetPreferredPosition()DimensiongetPreferredSize()floatgetPriority()The overlay priority, which determines the order the overlay renders in relative to other overlays.booleanisDragTargetable()Whether this overlay can be dragged onto other overlays & have other overlays dragged onto it.booleanisMovable()Whether this overlay can be moved with altbooleanisResettable()booleanisResizable()booleanisSnappable()Whether this overlay can be moved to a snap corner and have its preferredPosition changedbooleanonDrag(Overlay other)Called when an overlay is dragged onto this, if dragTargetable is true.voidonMouseOver()voidremoveMenuEntry(MenuAction action, String option, String target)voidrevalidate()voidsetBounds(Rectangle bounds)protected voidsetDragTargetable(boolean dragTargetable)Whether this overlay can be dragged onto other overlays & have other overlays dragged onto it.voidsetLayer(OverlayLayer layer)voidsetMinimumSize(int minimumSize)protected voidsetMovable(boolean movable)Whether this overlay can be moved with altvoidsetPosition(OverlayPosition position)voidsetPreferredLocation(Point preferredLocation)voidsetPreferredPosition(OverlayPosition preferredPosition)voidsetPreferredSize(Dimension preferredSize)voidsetPriority(float priority)voidsetPriority(OverlayPriority overlayPriority)voidsetResettable(boolean resettable)voidsetResizable(boolean resizable)protected voidsetSnappable(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.MANUALto avoid the overlay being drawn a 2nd time during the defaultOverlayLayer.UNDER_WIDGETSpass.- 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.MANUALto avoid the overlay being drawn a 2nd time during the defaultOverlayLayer.UNDER_WIDGETSpass. The layer must be a widget ofWidgetTypeWidgetType.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.MANUALto avoid the overlay being drawn a 2nd time during the defaultOverlayLayer.UNDER_WIDGETSpass. The layer must be a widget ofWidgetTypeWidgetType.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.MANUALto avoid the overlay being drawn a 2nd time during the defaultOverlayLayer.UNDER_WIDGETSpass. The layer must be a widget ofWidgetTypeWidgetType.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:
getBoundsin 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:
setPreferredLocationin interfaceLayoutableRenderableEntity
-
setPreferredSize
public void setPreferredSize(Dimension preferredSize)
- Specified by:
setPreferredSizein 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
-
-