Package net.runelite.api.hooks
Interface Callbacks
-
public interface Callbacks
Interface of callbacks the injected client uses to send events
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
draw(MainBufferProvider mainBufferProvider, Graphics graphics, int x, int y)
Client top-most draw method, rendering over top of most of game interfaces.boolean
draw(Renderable renderable, boolean drawingUi)
Called to test if a renderable should be drawn this framevoid
drawAboveOverheads()
Called after logic that is drawing 2D objects is processed.void
drawInterface(int interfaceId, List<WidgetItem> widgetItems)
Called after an interface has been drawnvoid
drawLayer(Widget layer, List<WidgetItem> widgetItems)
Called after a widget layer has been drawnvoid
drawScene()
Called after the scene is drawn.void
error(String message, Throwable reason)
Called when a client error occursvoid
frame()
Called each frameboolean
isRuneLiteClientOutdated()
Returns if the current runelite client is outdated or notvoid
keyPressed(KeyEvent keyEvent)
Key pressed event.void
keyReleased(KeyEvent keyEvent)
Key released event.void
keyTyped(KeyEvent keyEvent)
Key typed event.MouseEvent
mouseClicked(MouseEvent mouseEvent)
Mouse clicked event.MouseEvent
mouseDragged(MouseEvent mouseEvent)
Mouse dragged event.MouseEvent
mouseEntered(MouseEvent mouseEvent)
Mouse entered event.MouseEvent
mouseExited(MouseEvent mouseEvent)
Mouse exited event.MouseEvent
mouseMoved(MouseEvent mouseEvent)
Mouse moved event.MouseEvent
mousePressed(MouseEvent mouseEvent)
Mouse pressed event.MouseEvent
mouseReleased(MouseEvent mouseEvent)
Mouse released event.MouseWheelEvent
mouseWheelMoved(MouseWheelEvent event)
Mouse wheel moved event.void
openUrl(String url)
Called when the client wants to open a URLvoid
post(Object event)
Post an event.void
postDeferred(Object event)
Post a deferred event, which gets delayed until the next cycle.void
serverTick()
Called each server tickvoid
tick()
Called at the beginning of each tickvoid
tickEnd()
Called at the end of each tick
-
-
-
Method Detail
-
post
void post(Object event)
Post an event. See the events in net.runelite.api.events.- Parameters:
event
- the event
-
postDeferred
void postDeferred(Object event)
Post a deferred event, which gets delayed until the next cycle.- Parameters:
event
- the event
-
tick
void tick()
Called at the beginning of each tick
-
tickEnd
void tickEnd()
Called at the end of each tick
-
frame
void frame()
Called each frame
-
serverTick
void serverTick()
Called each server tick
-
drawScene
void drawScene()
Called after the scene is drawn.
-
drawAboveOverheads
void drawAboveOverheads()
Called after logic that is drawing 2D objects is processed.
-
draw
void draw(MainBufferProvider mainBufferProvider, Graphics graphics, int x, int y)
Client top-most draw method, rendering over top of most of game interfaces.- Parameters:
mainBufferProvider
- the main buffer providergraphics
- the graphicsx
- the xy
- the y
-
drawInterface
void drawInterface(int interfaceId, List<WidgetItem> widgetItems)
Called after an interface has been drawn- Parameters:
interfaceId
- the interface idwidgetItems
- Widget items within the interface
-
drawLayer
void drawLayer(Widget layer, List<WidgetItem> widgetItems)
Called after a widget layer has been drawn- Parameters:
layer
- The layerwidgetItems
- Widget items within the layer
-
mousePressed
MouseEvent mousePressed(MouseEvent mouseEvent)
Mouse pressed event. If this event will be consumed it will not be propagated further to client.- Parameters:
mouseEvent
- the mouse event- Returns:
- the mouse event
-
mouseReleased
MouseEvent mouseReleased(MouseEvent mouseEvent)
Mouse released event. If this event will be consumed it will not be propagated further to client.- Parameters:
mouseEvent
- the mouse event- Returns:
- the mouse event
-
mouseClicked
MouseEvent mouseClicked(MouseEvent mouseEvent)
Mouse clicked event. If this event will be consumed it will not be propagated further to client.- Parameters:
mouseEvent
- the mouse event- Returns:
- the mouse event
-
mouseEntered
MouseEvent mouseEntered(MouseEvent mouseEvent)
Mouse entered event. If this event will be consumed it will not be propagated further to client.- Parameters:
mouseEvent
- the mouse event- Returns:
- the mouse event
-
mouseExited
MouseEvent mouseExited(MouseEvent mouseEvent)
Mouse exited event. If this event will be consumed it will not be propagated further to client.- Parameters:
mouseEvent
- the mouse event- Returns:
- the mouse event
-
mouseDragged
MouseEvent mouseDragged(MouseEvent mouseEvent)
Mouse dragged event. If this event will be consumed it will not be propagated further to client.- Parameters:
mouseEvent
- the mouse event- Returns:
- the mouse event
-
mouseMoved
MouseEvent mouseMoved(MouseEvent mouseEvent)
Mouse moved event. If this event will be consumed it will not be propagated further to client.- Parameters:
mouseEvent
- the mouse event- Returns:
- the mouse event
-
mouseWheelMoved
MouseWheelEvent mouseWheelMoved(MouseWheelEvent event)
Mouse wheel moved event. If this event will be consumed it will not be propagated further to client.- Parameters:
event
- the event- Returns:
- the mouse wheel event
-
keyPressed
void keyPressed(KeyEvent keyEvent)
Key pressed event.- Parameters:
keyEvent
- the key event
-
keyReleased
void keyReleased(KeyEvent keyEvent)
Key released event.- Parameters:
keyEvent
- the key event
-
keyTyped
void keyTyped(KeyEvent keyEvent)
Key typed event.- Parameters:
keyEvent
- the key event
-
draw
boolean draw(Renderable renderable, boolean drawingUi)
Called to test if a renderable should be drawn this frame- Parameters:
renderable
- the renderabledrawingUi
- if this is the 2d ui, such as hp bars or hitsplats- Returns:
- false to prevent drawing
-
error
void error(String message, Throwable reason)
Called when a client error occurs- Parameters:
message
-reason
-
-
openUrl
void openUrl(String url)
Called when the client wants to open a URL- Parameters:
url
-
-
isRuneLiteClientOutdated
boolean isRuneLiteClientOutdated()
Returns if the current runelite client is outdated or not- Returns:
-
-