Package net.runelite.api
Interface TileObject
-
- All Known Subinterfaces:
DecorativeObject
,GameObject
,GroundObject
,ItemLayer
,WallObject
public interface TileObject
Represents an object on a Tile
-
-
Field Summary
Fields Modifier and Type Field Description static int
HASH_PLANE_SHIFT
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Point
getCanvasLocation()
Calculates the position of the center of this tile on the canvasPoint
getCanvasLocation(int zOffset)
Calculates the position of the center of this tile on the canvasPoint
getCanvasTextLocation(Graphics2D graphics, String text, int zOffset)
Calculates the canvas point to centertext
above the tile this object is on.Polygon
getCanvasTilePoly()
Creates a polygon outlining the tile this object is onShape
getClickbox()
Calculate the on-screen clickable area of the object.long
getHash()
A bitfield containing various flags:int
getId()
Gets the ID of the object.LocalPoint
getLocalLocation()
Get the local location for this object.Point
getMinimapLocation()
Gets a point on the canvas of where this objects mini-map indicator should appear.int
getPlane()
Gets the plane of the tile that the object is on.WorldPoint
getWorldLocation()
Get the world location for this object.WorldView
getWorldView()
Gets the WorldView this TileObject is a part of.int
getX()
Gets the x-axis coordinate of the object in local context.int
getY()
Gets the y-axis coordinate of the object in local context.int
getZ()
Gets the vertical coordinate of this object
-
-
-
Field Detail
-
HASH_PLANE_SHIFT
static final int HASH_PLANE_SHIFT
- See Also:
- Constant Field Values
-
-
Method Detail
-
getHash
long getHash()
A bitfield containing various flags:
Type 0 = player, 1 = npc, 2 = game object, 3 = item(RL) plane = bits >> 60 & 3 worldView = bits >> 49 & 2047 id = bits >> 17 & 0xffffffff wall = bits >> 16 & 1 type = bits >> 14 & 3 scene y = bits >> 7 & 127 scene x = bits >> 0 & 127
-
getX
int getX()
Gets the x-axis coordinate of the object in local context.- See Also:
LocalPoint
-
getY
int getY()
Gets the y-axis coordinate of the object in local context.- See Also:
LocalPoint
-
getZ
int getZ()
Gets the vertical coordinate of this object
-
getPlane
int getPlane()
Gets the plane of the tile that the object is on.
-
getWorldView
WorldView getWorldView()
Gets the WorldView this TileObject is a part of.
-
getId
int getId()
Gets the ID of the object.- See Also:
ObjectID
,NullObjectID
-
getWorldLocation
@Nonnull WorldPoint getWorldLocation()
Get the world location for this object. For objects which are larger than 1 tile, this is the center most tile, rounded to the south-west.- Returns:
-
getLocalLocation
@Nonnull LocalPoint getLocalLocation()
Get the local location for this object. This point is the center point of the object.- Returns:
-
getCanvasLocation
@Nullable Point getCanvasLocation()
Calculates the position of the center of this tile on the canvas
-
getCanvasLocation
@Nullable Point getCanvasLocation(int zOffset)
Calculates the position of the center of this tile on the canvas- Parameters:
zOffset
- Vertical offset to apply before projection
-
getCanvasTilePoly
@Nullable Polygon getCanvasTilePoly()
Creates a polygon outlining the tile this object is on
-
getCanvasTextLocation
@Nullable Point getCanvasTextLocation(Graphics2D graphics, String text, int zOffset)
Calculates the canvas point to centertext
above the tile this object is on.- Parameters:
graphics
- the graphics to use for font size calculationzOffset
- Vertical offset to apply before projection- Returns:
- the canvas point to draw the text at
-
getMinimapLocation
@Nullable Point getMinimapLocation()
Gets a point on the canvas of where this objects mini-map indicator should appear.- Returns:
- mini-map location on canvas
-
getClickbox
@Nullable Shape getClickbox()
Calculate the on-screen clickable area of the object.
-
-