Package net.runelite.api
Interface Actor
-
- All Superinterfaces:
Node
,Renderable
public interface Actor extends Renderable
Represents a RuneScape actor/entity.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description void
clearSpotAnims()
Remove all actor spotanimsvoid
createSpotAnim(int id, int spotAnimId, int height, int delay)
Create an actor spotanimint
getAnimation()
Gets the current animation the actor is performing.int
getAnimationFrame()
Get the frame of the animation the actor is performingPoint
getCanvasImageLocation(BufferedImage image, int zOffset)
Gets the point at which an image should be drawn, relative to the current location with the given z-axis offset.Point
getCanvasSpriteLocation(SpritePixels sprite, int zOffset)
Gets the point at which a sprite should be drawn, relative to the current location with the given z-axis offset.Point
getCanvasTextLocation(Graphics2D graphics, String text, int zOffset)
Gets the point at which text should be drawn, relative to the current location with the given z-axis offset.Polygon
getCanvasTilePoly()
Gets the canvas area of the current tiles the actor is standing on.int
getCombatLevel()
Gets the combat level of the actor.Shape
getConvexHull()
Gets the convex hull of the actors model.int
getCurrentOrientation()
Gets the current orientation of the actor.int
getGraphic()
Deprecated.seehasSpotAnim(int)
int
getGraphicHeight()
Deprecated.int
getHealthRatio()
Gets the health of the actor ingetHealthScale()
units.int
getHealthScale()
Gets the maximum valuegetHealthRatio()
can return For actors with the default size health bar this is 30, but for bosses with a larger health bar this can be a larger number.int
getIdlePoseAnimation()
The idle pose animation.int
getIdleRotateLeft()
Animation used for rotating left if the actor is also not walkingint
getIdleRotateRight()
Animation used for rotating right if the actor is also not walkingActor
getInteracting()
Gets the actor being interacted with.LocalPoint
getLocalLocation()
Gets the client-side location of the actor.int
getLogicalHeight()
Gets the logical height of the actors model.Point
getMinimapLocation()
Gets a point on the canvas of where this actors mini-map indicator should appear.String
getName()
Gets the name of the actor.int
getOrientation()
Gets the target orientation of the actor.int
getOverheadCycle()
Get the number of cycles/client ticks remaining before the overhead text is timed outString
getOverheadText()
Gets the overhead text that is displayed above the actorint
getPoseAnimation()
Gets the secondary animation the actor is performing.int
getPoseAnimationFrame()
Get the frame of the idle animation the actor is performingint
getRunAnimation()
Animation used for runningint
getSpotAnimFrame()
Deprecated.IterableHashTable<ActorSpotAnim>
getSpotAnims()
Get the spotanims on the actor.int
getWalkAnimation()
Animation used for walkingint
getWalkRotate180()
Animation used for an about-face while walkingint
getWalkRotateLeft()
Animation used for rotating left while walkingint
getWalkRotateRight()
Animation used for rotating right while walkingWorldArea
getWorldArea()
Gets the world area that the actor occupies.WorldPoint
getWorldLocation()
Gets the server-side location of the actor.WorldView
getWorldView()
Get theWorldView
this actor belongs toboolean
hasSpotAnim(int spotAnimId)
Check if the actor has a spotanimboolean
isDead()
Returns true if this actor has diedboolean
isInteracting()
Gets if the actor is interacting with another actor.void
removeSpotAnim(int id)
Remove an actor spotanimvoid
setActionFrame(int frame)
Deprecated.use setAnimationFramevoid
setAnimation(int animation)
Sets an animation for the actor to perform.void
setAnimationFrame(int frame)
Sets the frame of the animation the actor is performing.void
setDead(boolean dead)
Sets the dead status of this actorvoid
setGraphic(int graphic)
Deprecated.void
setGraphicHeight(int height)
Deprecated.void
setIdlePoseAnimation(int animation)
void
setIdleRotateLeft(int animationID)
void
setIdleRotateRight(int animationID)
void
setOverheadCycle(int cycles)
Set the number of cycles/client ticks before the overhead text is timed outvoid
setOverheadText(String overheadText)
Sets the overhead text that is displayed above the actorvoid
setPoseAnimation(int animation)
Set the idle pose animation.void
setPoseAnimationFrame(int frame)
Set the frame of the idle animation the actor is performingvoid
setRunAnimation(int animationID)
void
setSpotAnimFrame(int spotAnimFrame)
Deprecated.void
setWalkAnimation(int animationID)
void
setWalkRotate180(int animationID)
void
setWalkRotateLeft(int animationID)
void
setWalkRotateRight(int animationID)
-
Methods inherited from interface net.runelite.api.Node
getHash, getNext, getPrevious
-
Methods inherited from interface net.runelite.api.Renderable
getModel, getModelHeight, setModelHeight
-
-
-
-
Method Detail
-
getCombatLevel
int getCombatLevel()
Gets the combat level of the actor.- Returns:
- the combat level
-
getName
@Nullable String getName()
Gets the name of the actor.- Returns:
- the name
-
isInteracting
boolean isInteracting()
Gets if the actor is interacting with another actor.getInteracting()
will return the interacting actor, unless they are outside of the visibility range.- Returns:
-
getInteracting
Actor getInteracting()
Gets the actor being interacted with.Examples of interaction include:
- A monster focusing an Actor to attack
- Targetting a player to trade
- Following a player
- Returns:
- the actor, null if no interaction is occurring
-
getHealthRatio
int getHealthRatio()
Gets the health of the actor ingetHealthScale()
units. The server does not transmit actors' real health, only this value between zero andgetHealthScale()
. Some actors may be missing this info, in which case -1 is returned.
-
getHealthScale
int getHealthScale()
Gets the maximum valuegetHealthRatio()
can return For actors with the default size health bar this is 30, but for bosses with a larger health bar this can be a larger number. Some actors may be missing this info, in which case -1 is returned.
-
getWorldLocation
WorldPoint getWorldLocation()
Gets the server-side location of the actor.This value is typically ahead of where the client renders and is not affected by things such as animations.
- Returns:
- the server location
-
getLocalLocation
LocalPoint getLocalLocation()
Gets the client-side location of the actor.- Returns:
- the client location
-
getOrientation
int getOrientation()
Gets the target orientation of the actor.- Returns:
- the orientation
- See Also:
Angle
-
getCurrentOrientation
int getCurrentOrientation()
Gets the current orientation of the actor.- Returns:
- the orientation
- See Also:
Angle
-
getAnimation
int getAnimation()
Gets the current animation the actor is performing.- Returns:
- the animation ID
- See Also:
AnimationID
-
getPoseAnimation
int getPoseAnimation()
Gets the secondary animation the actor is performing. Usually an idle animation, or one of the walking ones.- Returns:
- the animation ID
- See Also:
AnimationID
-
setPoseAnimation
void setPoseAnimation(int animation)
Set the idle pose animation.- Parameters:
animation
-- See Also:
AnimationID
-
getPoseAnimationFrame
int getPoseAnimationFrame()
Get the frame of the idle animation the actor is performing- Returns:
-
setPoseAnimationFrame
void setPoseAnimationFrame(int frame)
Set the frame of the idle animation the actor is performing- Parameters:
frame
-
-
getIdlePoseAnimation
int getIdlePoseAnimation()
The idle pose animation. If the actor is not walking or otherwise animating, this will be used for their pose animation.- Returns:
- the animation ID
- See Also:
AnimationID
-
setIdlePoseAnimation
@VisibleForDevtools void setIdlePoseAnimation(int animation)
-
getIdleRotateLeft
int getIdleRotateLeft()
Animation used for rotating left if the actor is also not walking- Returns:
- the animation ID
- See Also:
AnimationID
-
setIdleRotateLeft
void setIdleRotateLeft(int animationID)
-
getIdleRotateRight
int getIdleRotateRight()
Animation used for rotating right if the actor is also not walking- Returns:
- the animation ID
- See Also:
AnimationID
-
setIdleRotateRight
void setIdleRotateRight(int animationID)
-
getWalkAnimation
int getWalkAnimation()
Animation used for walking- Returns:
- the animation ID
- See Also:
AnimationID
-
setWalkAnimation
void setWalkAnimation(int animationID)
-
getWalkRotateLeft
int getWalkRotateLeft()
Animation used for rotating left while walking- Returns:
- the animation ID
- See Also:
AnimationID
-
setWalkRotateLeft
void setWalkRotateLeft(int animationID)
-
getWalkRotateRight
int getWalkRotateRight()
Animation used for rotating right while walking- Returns:
- the animation ID
- See Also:
AnimationID
-
setWalkRotateRight
void setWalkRotateRight(int animationID)
-
getWalkRotate180
int getWalkRotate180()
Animation used for an about-face while walking- Returns:
- the animation ID
- See Also:
AnimationID
-
setWalkRotate180
void setWalkRotate180(int animationID)
-
getRunAnimation
int getRunAnimation()
Animation used for running- Returns:
- the animation ID
- See Also:
AnimationID
-
setRunAnimation
void setRunAnimation(int animationID)
-
setAnimation
@VisibleForDevtools void setAnimation(int animation)
Sets an animation for the actor to perform.- Parameters:
animation
- the animation ID- See Also:
AnimationID
-
getAnimationFrame
int getAnimationFrame()
Get the frame of the animation the actor is performing- Returns:
- the frame
-
setActionFrame
@Deprecated void setActionFrame(int frame)
Deprecated.use setAnimationFrameSets the frame of the animation the actor is performing.- Parameters:
frame
- the animation frame
-
setAnimationFrame
void setAnimationFrame(int frame)
Sets the frame of the animation the actor is performing.- Parameters:
frame
- the animation frame
-
getSpotAnims
IterableHashTable<ActorSpotAnim> getSpotAnims()
Get the spotanims on the actor. It is important to not modify the table directly or indirectly via eg. iterator remove().- Returns:
- See Also:
createSpotAnim(int, int, int, int)
,removeSpotAnim(int)
,clearSpotAnims()
-
hasSpotAnim
boolean hasSpotAnim(int spotAnimId)
Check if the actor has a spotanim- Parameters:
spotAnimId
- the spot anim id- Returns:
- See Also:
GraphicID
-
createSpotAnim
void createSpotAnim(int id, int spotAnimId, int height, int delay)
Create an actor spotanim- Parameters:
id
- key for thegetSpotAnims()
tablespotAnimId
- spotanim idGraphicID
height
- height offspot for spot animdelay
- initial delay, in client ticks, before spotanim is active
-
removeSpotAnim
void removeSpotAnim(int id)
Remove an actor spotanim- Parameters:
id
- key for thegetSpotAnims()
table
-
clearSpotAnims
void clearSpotAnims()
Remove all actor spotanims
-
getGraphic
@Deprecated int getGraphic()
Deprecated.seehasSpotAnim(int)
Get the graphic/spotanim that is currently on the actor. Actors can have multiple spotanims, this gets only one of them. UsehasSpotAnim(int)
instead.- Returns:
- the spotanim of the actor
- See Also:
GraphicID
-
setGraphic
@Deprecated void setGraphic(int graphic)
Deprecated.Set the graphic/spotanim that is currently on the actor.- Parameters:
graphic
- The spotanim id- See Also:
GraphicID
-
getGraphicHeight
@Deprecated int getGraphicHeight()
Deprecated.Get the height of the graphic/spotanim on the actor- Returns:
-
setGraphicHeight
@Deprecated void setGraphicHeight(int height)
Deprecated.Set the height of the graphic/spotanim on the actor- Parameters:
height
-
-
getSpotAnimFrame
@Deprecated int getSpotAnimFrame()
Deprecated.Get the frame of the currently playing spotanim- Returns:
-
setSpotAnimFrame
@Deprecated void setSpotAnimFrame(int spotAnimFrame)
Deprecated.Set the frame of the currently playing spotanim- Parameters:
spotAnimFrame
-
-
getCanvasTilePoly
Polygon getCanvasTilePoly()
Gets the canvas area of the current tiles the actor is standing on.- Returns:
- the current tile canvas area
-
getCanvasTextLocation
@Nullable Point getCanvasTextLocation(Graphics2D graphics, String text, int zOffset)
Gets the point at which text should be drawn, relative to the current location with the given z-axis offset.- Parameters:
graphics
- engine graphicstext
- the text to drawzOffset
- the z-axis offset- Returns:
- the text drawing location
-
getCanvasImageLocation
Point getCanvasImageLocation(BufferedImage image, int zOffset)
Gets the point at which an image should be drawn, relative to the current location with the given z-axis offset.- Parameters:
image
- the image to drawzOffset
- the z-axis offset- Returns:
- the image drawing location
-
getCanvasSpriteLocation
Point getCanvasSpriteLocation(SpritePixels sprite, int zOffset)
Gets the point at which a sprite should be drawn, relative to the current location with the given z-axis offset.- Parameters:
sprite
- the sprite to drawzOffset
- the z-axis offset- Returns:
- the sprite drawing location
-
getMinimapLocation
Point getMinimapLocation()
Gets a point on the canvas of where this actors mini-map indicator should appear.- Returns:
- mini-map location on canvas
-
getLogicalHeight
int getLogicalHeight()
Gets the logical height of the actors model.This z-axis offset is roughly where the health bar of the actor is drawn.
- Returns:
- the logical height
-
getConvexHull
Shape getConvexHull()
Gets the convex hull of the actors model.- Returns:
- the convex hull
- See Also:
Jarvis
-
getWorldArea
WorldArea getWorldArea()
Gets the world area that the actor occupies.- Returns:
- the world area
-
getOverheadText
String getOverheadText()
Gets the overhead text that is displayed above the actor- Returns:
- the overhead text
-
setOverheadText
void setOverheadText(String overheadText)
Sets the overhead text that is displayed above the actor- Parameters:
overheadText
- the overhead text
-
getOverheadCycle
int getOverheadCycle()
Get the number of cycles/client ticks remaining before the overhead text is timed out- Returns:
-
setOverheadCycle
void setOverheadCycle(int cycles)
Set the number of cycles/client ticks before the overhead text is timed out- Parameters:
cycles
-
-
isDead
boolean isDead()
Returns true if this actor has died- Returns:
-
setDead
void setDead(boolean dead)
Sets the dead status of this actor- Parameters:
dead
-- See Also:
isDead()
-
-